02.06.2011, 08:43
Well my code is this
And its pasted in OnPlayerCommandText
and the error messages i get when i compile are those:
Код:
if (strcmp("/givemoney", cmdtext, true) == 0){ new tmp[256], tmp2[256]; tmp = strtok(cmdtext, idx); tmp2 = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /givemoney [playerid] [amount]"); return 1; } if(!strlen(tmp2)) { SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /givemoney [playerid] [amount]"); return 1; } new receiver, money; receiver = strval(tmp); money = strval(tmp2); if(GetPlayerMoney(playerid) < money) { SendClientMessage(playerid, 0xFFFFFFFF, "You dont have that much in your pocket foo'"); return 1; } new string[128]; new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, sizeof(playername)); new playername2[MAX_PLAYER_NAME]; GetPlayerName(receiver, playername2, sizeof(playername2)); format(string, sizeof(string), "You recieved %d$ from %s", money, playername); SendClientMessage(playerid,0xFFFFFFFF,string); format(string, sizeof(string), "You gave %d$ to %s", money, playername2); SendClientMessage(playerid,0xFFFFFFFF,string); GivePlayerMoney(playerid, (0 - money)); GivePlayerMoney(receiver, money); return 1; } return 0; }
and the error messages i get when i compile are those:
Код:
C:\PROGRA~1\ROCKST~1\GTASAN~1\SAMP03~1\GAMEMO~1\OHNOES~1.PWN(231) : error 017: undefined symbol "idx" C:\PROGRA~1\ROCKST~1\GTASAN~1\SAMP03~1\GAMEMO~1\OHNOES~1.PWN(232) : error 017: undefined symbol "idx"