17.05.2009, 13:10
Whats wrong with this? It is supose to give the player 1+ weed (I have my own weed system)
Код:
if(!strcmp(cmdtext,"/giveweed",true, 9)) { if(!strlen(cmdtext[9])) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /giveweed [playerid]"); if(hasweed[playerid] <= 0) return SendClientMessage(playerid,0xFF0000AA,"You don't have any weed to give out!"); new giveid = strval(cmdtext[10]); if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, 0xFF0000AA, "That player isnt connected"); new string[128], string2[128]; new adminname[MAX_PLAYER_NAME], bringname[MAX_PLAYER_NAME]; GetPlayerName(giveid, givename, sizeof(givename)); GetPlayerName(playerid, adminname, sizeof(adminname)); format(string,sizeof(string),">> You have given %s 1 unit of weed", givename); SendClientMessage(playerid,0xFF8000FF, string); format(string2,sizeof(string2),">> You have received 1 unit of weed from %s ", adminname); SendClientMessage(giveid,0xFF8000FF, string2); GivePlayerMoney(giveid,-1000); GivePlayerMoney(playerid, 1000); hasweed[giveid]++; hasweed[playerid]--; return 1; }
Код:
C:\Documents and Settings\Salim\Desktop\SalsTestinGrounds\SalsTestingGrounds.pwn(720) : warning 219: local variable "string" shadows a variable at a preceding level C:\Documents and Settings\Salim\Desktop\SalsTestinGrounds\SalsTestingGrounds.pwn(722) : error 017: undefined symbol "givename" C:\Documents and Settings\Salim\Desktop\SalsTestinGrounds\SalsTestingGrounds.pwn(722) : error 017: undefined symbol "givename" C:\Documents and Settings\Salim\Desktop\SalsTestinGrounds\SalsTestingGrounds.pwn(722) : error 029: invalid expression, assumed zero C:\Documents and Settings\Salim\Desktop\SalsTestinGrounds\SalsTestingGrounds.pwn(722) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.