26.05.2010, 20:18
Код:
if(strcmp(cmd, "/givecash", true) == 0) { new tmp[256]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, VALGE, "USAGE: /givecash [playerid] [amount]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, VALGE, "USAGE: /givecash [playerid] [amount]"); return 1; } moneys = strval(tmp); 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), "* Sa saatsid %s %d krooni", giveplayer,moneys); SendClientMessage(playerid, LILLA, string); format(string, sizeof(string), "* Sa said %d krooni Saatja: %s", moneys, sendername); SendClientMessage(giveplayerid, LILLA, string); printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid); } else { SendClientMessage(playerid, PUNANE, "Vale Summa"); } } else { format(string, sizeof(string), "%d pole serveris!", giveplayerid); SendClientMessage(playerid, PUNANE, string); } return 1; }
Код:
C:\DOCUME~1\Andrus\Desktop\ARMBYA~1\GAMEMO~1\rp.pwn(649) : warning 219: local variable "tmp" shadows a variable at a preceding level C:\DOCUME~1\Andrus\Desktop\ARMBYA~1\GAMEMO~1\rp.pwn(655) : error 017: undefined symbol "giveplayerid" C:\DOCUME~1\Andrus\Desktop\ARMBYA~1\GAMEMO~1\rp.pwn(661) : error 017: undefined symbol "moneys" C:\DOCUME~1\Andrus\Desktop\ARMBYA~1\GAMEMO~1\rp.pwn(662) : error 017: undefined symbol "giveplayerid" C:\DOCUME~1\Andrus\Desktop\ARMBYA~1\GAMEMO~1\rp.pwn(663) : error 017: undefined symbol "giveplayerid" C:\DOCUME~1\Andrus\Desktop\ARMBYA~1\GAMEMO~1\rp.pwn(663) : error 017: undefined symbol "giveplayer" C:\DOCUME~1\Andrus\Desktop\ARMBYA~1\GAMEMO~1\rp.pwn(663) : error 029: invalid expression, assumed zero C:\DOCUME~1\Andrus\Desktop\ARMBYA~1\GAMEMO~1\rp.pwn(663) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 7 Errors.