GTAOnline.net
San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: TheAlex86 le 17 Novembre 2009, 13:54:18
-
Bonjour. voila j'ai un pti probleme, et je ne comprend pas pourquoi ça ne marche pas.
voila je usis parti d'une base GFquand on est dealer arme on doit faire une commande /matos obtenir [nmbre de paquet] et on paye seon ce qu'on obtien ensuite ça se met dans nos stats le nombre de matériels.
mon probleme est qu'on paye bien ici mais que nos stat reste a zéro.
Voila le code.
if(strcmp(cmd,"/matos",true)==0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pJob] != 9)
{
SendClientMessage(playerid,COLOR_GREY," Tu n'es pas a Dealer d'armes !");
return 1;
}
new x_nr[256];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /matos obtenir[nombre]");
return 1;
}
if(strcmp(x_nr,"obtenir",true) == 0)
{
if(PlayerToPoint(3.0,playerid,-2536.3147,63.2972,9.2332))
{
if(MatsHolding[playerid] >= 10)
{
SendClientMessage(playerid, COLOR_GREY, " Vous ne pouvez pas tenir plus des Paquets de Matériel !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /matos obtenir [ammount]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 10) { SendClientMessage(playerid, COLOR_GREY, " entre 1 et 10 paquets !"); return 1; }
new price = moneys * 100;
if(GetPlayerMoney(playerid) > price)
{
format(string, sizeof(string), "* vous acheter %d matos pour $%d.", moneys, price);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, - price);
MatsHolding[playerid] = moneys;
}
else
{
format(string, sizeof(string), " Tu ne peu pas te permetre ça $%d !", price);
SendClientMessage(playerid, COLOR_GREY, string);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Tu n'es pas a l'endroit ou on trouve les paquets !");
return 1;
}
}
merci beaucoup.
-
Tu as pas mis le GivePlayerMats ou je l'ai pas vu :
http://pastebin.gtaonline.fr/pastebin.php?show=702 (http://pastebin.gtaonline.fr/pastebin.php?show=702)
-
a de fait j'ai pas mis . je sais pas que mettre nii ou?...
eu dans le tien il y es pas non plus si?
car pareil avec le tien ça me le met pas dans les stats denouveau,...
-
désole du double post mais je trouve vraiment pas la solution quelqun aurai une idée?