Hi,all,I need help again.I made this command but it have many errors.Can you help me?
[pawn] else if (strcmp(cmd, "!givecash", true) == 0)
{
tmp = strtok(cmdtext, idx);
new len = strlen(tmp);
new plr;
plr = FindPlayerIDFromString(tmp);
if (!len) { format(szMsg,sizeof(szMsg),"Usage: !givecash [playerid] [100/500/1000].",tmp);SendClientMessage(playerid, COLOR_GREY, szMsg);return 1;}
else if ( plr == INACTIVE_PLAYER_ID ) SendClientMessage( playerid, COLOR_RED, "Error: Unknown player" );
else {
if(strcmp(tmp, "100", true) == 0)
{
if {(GetPlayerMoney(playerid) < 100) SendClientMessage( playerid, COLOR_GREEN, "Error: You havent got the needed money." );return 1;}
else{
SetPlayerMoney(plr, GetPlayerMoney(plr) + 100);
SetPlayerMoney(playerid, GetPlayerMoney(playerid) - 100);
format(szMsg,256,"%s has use !givecash to given %s [100].",gPlayers[ playerid ],gPlayers[ plr ]);
SendClientMessageToAll(COLOR_LIGHTBLUE, szMsg);
}
return 1;
}
else if(strcmp(tmp, "500", true) == 0)
{
if {(GetPlayerMoney(playerid) < 500) SendClientMessage( playerid, COLOR_GREEN, "Error: You havent got the needed money." );return 1;}
else{
SetPlayerMoney(plr, GetPlayerMoney(plr) + 500);
SetPlayerMoney(playerid, GetPlayerMoney(playerid) - 500);
format(szMsg,256,"%s has use !givecash to given %s [500].",gPlayers[ playerid ],gPlayers[ plr ]);
SendClientMessageToAll(COLOR_LIGHTBLUE, szMsg);
}
return 1;
}
else if(strcmp(tmp, "1000", true) == 0)
{
if {(GetPlayerMoney(playerid) < 1000) SendClientMessage( playerid, COLOR_GREEN, "Error: You havent got the needed money." );return 1;}
else{
SetPlayerMoney(plr, GetPlayerMoney(plr) + 1000);
SetPlayerMoney(playerid, GetPlayerMoney(playerid) - 1000);
format(szMsg,256,"%s has use !givecash to given %s [1000].",gPlayers[ playerid ],gPlayers[ plr ]);
SendClientMessageToAll(COLOR_LIGHTBLUE, szMsg);
}
return 1;
}
}
return 1;
}[/pawn]
errors:
D:\VCMP JIANFU2\gamemodes\mode.pwn(1744) : error 001: expected token: "(", but found "{"
D:\VCMP JIANFU2\gamemodes\mode.pwn(1753) : error 029: invalid expression, assumed zero
D:\VCMP JIANFU2\gamemodes\mode.pwn(1753) : warning 215: expression has no effect
D:\VCMP JIANFU2\gamemodes\mode.pwn(1753) : error 001: expected token: ";", but found "if"
D:\VCMP JIANFU2\gamemodes\mode.pwn(1755) : error 001: expected token: "(", but found "{"
D:\VCMP JIANFU2\gamemodes\mode.pwn(1766) : error 001: expected token: "(", but found "{"
D:\VCMP JIANFU2\gamemodes\mode.pwn(1768) : error 017: undefined symbol "plr"
D:\VCMP JIANFU2\gamemodes\mode.pwn(1770) : error 017: undefined symbol "plr"
D:\VCMP JIANFU2\gamemodes\mode.pwn(1775) : error 054: unmatched closing brace
D:\VCMP JIANFU2\gamemodes\mode.pwn(1776) : error 010: invalid function or declaration
D:\VCMP JIANFU2\gamemodes\mode.pwn(1778) : error 010: invalid function or declaration
Can you help me?