21.11.2009, 23:24
I'm trying to create /give [ID/PartOfName] [item] [amount] but im not succeding.
Here's my code:
I didn't even finish the command and i get this errors:
Please help me fix it. Thank you.
Here's my code:
pawn Код:
cmd(give, playerid, params[])
{
if(IsPlayerConnected(playerid) && PlayerLoggedIn[playerid])
{
new player[32];
new item[128];
new amount[32];
sscanf(params, "uss", player, item, amount);
if(isnull(player))
{
SendClientMessage(playerid, COLOR_HELP, "USAGE: /give [ID/PartOfName] [item] [amount]");
SendClientMessage(playerid, COLOR_HELP, "ITEMS: money, gun");
return 1;
}
if(isnull(item))
{
SendClientMessage(playerid, COLOR_HELP, "USAGE: /give [ID/PartOfName] [item] [amount]");
SendClientMessage(playerid, COLOR_HELP, "ITEMS: money, gun");
return 1;
}
if(!strcmp(item, "money"))
{
if(isnull(amount))
{
SendClientMessage(playerid, COLOR_HELP, "USAGE: /give [ID/PartOfName] [item] [amount]");
SendClientMessage(playerid, COLOR_HELP, "ITEM: money, gun");
return 1;
}
GivePlayerCash(playerid,-amount); // Line: 3285
GivePlayerCash(player,amount); // Line: 3286
}
}
return 1;
}
Код:
C:\Documents and Settings\Ivan\Desktop\SERVER\gamemodes\cgrpg.pwn(3285) : error 035: argument type mismatch (argument 2) C:\Documents and Settings\Ivan\Desktop\SERVER\gamemodes\cgrpg.pwn(3286) : error 035: argument type mismatch (argument 1)