CMD:utal(playerid,params[])
{
new tmp[256];
new playermoney;
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new giveplayerid, moneys;
new string[256];
tmp = strtok(params);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, \"Használat: /utal [játékosid] [összeg]\");
return 1;
}
giveplayerid = strval(tmp);
tmp = strtok(params);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, \"Használat: /utal [játékosid] [összeg]\");
return 1;
}
moneys = strval(tmp);
//printf(\"givecash_command: %d %d\",giveplayerid,moneys);
if (IsPlayerConnected(giveplayerid)) {
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
if (moneys > 0 && playermoney >= moneys) {
GivePlayerMoney(playerid, (0 - moneys));
GivePlayerMoney(giveplayerid, moneys);
format(string, sizeof(string), \"Elküldtél %s(játékos: %d), %d$.\", giveplayer,giveplayerid, moneys);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), \"Pénzt kaptál %d$ %s-tõl.(játékos: %d).\", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
printf(\"%s(játékos:%d) küldött %d$ %s-nak/nek(játékos:%d)\",sendername, playerid, moneys, giveplayer, giveplayerid);
}
else {
SendClientMessage(playerid, COLOR_YELLOW, \"Ismeretlen tranzakció.\");
}
}
else {
format(string, sizeof(string), \"%d nincs fenn a szerveren.\", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 1;
}
íme a kód, erre ezeket a warningokat adja:
C:\\Users\\Dani\\Desktop\\xtremefull\\gamemodes\\lvdm.pwn(154) : warning 202: number of arguments does not match definition
C:\\Users\\Dani\\Desktop\\xtremefull\\gamemodes\\lvdm.pwn(160) : warning 202: number of arguments does not match definition
154 sor: tmp = strtok(params);
160 sor: tmp = strtok(params);