30.03.2010, 02:50
Script:
Error:
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmd, "/givecash", true) == 0) { //4015 new string[256]; new playermoney; //4017 new sendername[MAX_PLAYER_NAME]; new giveplayer[MAX_PLAYER_NAME]; new giveplayerid, moneys, idxx; new tmp[256]; tmp = strtok(cmdtext, idxx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givecash [playerid] [amount]"); return 1; } giveplayerid = strval(tmp); tmp = strtok(cmdtext, idxx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givecash [playerid] [amount]"); return 1; } moneys = strval(tmp); //printf("givecash_command: %d %d",giveplayerid,moneys); 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), "You have sent %s(%d), $%d.", giveplayer,giveplayerid, moneys); SendClientMessage(playerid, COLOR_YELLOW, string); format(string, sizeof(string), "You have recieved $%d from %s(%d).", moneys, sendername, playerid); SendClientMessage(giveplayerid, COLOR_YELLOW, string); printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid); } else { SendClientMessage(playerid, COLOR_YELLOW, "Invalid transaction amount."); } } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; }
Код:
C:\Users\proprietario\Desktop\Tutto\Sa-Mp\GM\Clan Drift\gamemodes\ClanDrift.pwn(4015) : error 017: undefined symbol "cmd" C:\Users\proprietario\Desktop\Tutto\Sa-Mp\GM\Clan Drift\gamemodes\ClanDrift.pwn(4017) : warning 217: loose indentation C:\Users\proprietario\Desktop\Tutto\Sa-Mp\GM\Clan Drift\gamemodes\ClanDrift.pwn(4022) : error 017: undefined symbol "strtok" C:\Users\proprietario\Desktop\Tutto\Sa-Mp\GM\Clan Drift\gamemodes\ClanDrift.pwn(4022) : error 033: array must be indexed (variable "tmp") C:\Users\proprietario\Desktop\Tutto\Sa-Mp\GM\Clan Drift\gamemodes\ClanDrift.pwn(4030) : error 017: undefined symbol "strtok" C:\Users\proprietario\Desktop\Tutto\Sa-Mp\GM\Clan Drift\gamemodes\ClanDrift.pwn(4030) : error 033: array must be indexed (variable "tmp") C:\Users\proprietario\Desktop\Tutto\Sa-Mp\GM\Clan Drift\gamemodes\ClanDrift.pwn(4020) : warning 203: symbol is never used: "idxx" C:\Users\proprietario\Desktop\Tutto\Sa-Mp\GM\Clan Drift\gamemodes\ClanDrift.pwn(4020 -- 4065) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.