15.08.2009, 15:21
the code :
the error :
C:\Documents and Settings\Azizo\Bureau\Los Santos Stories Role Play\gamemodes\rpg.pwn(4269) : error 033: array must be indexed (variable "reason")
the line 4269 is :
if(reason == "Weapon licence")
Thanks for your help =)
Код:
if(strcmp(cmd, "/giveitem", true) == 0) // Kicks the player from the server { new reason[128]; tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, ORANGE, "USAGE: /giveitem [playername/id] [item]"); SendClientMessage(playerid, ORANGE, "FUNCTION: Will give an item to another player."); return 1; } new giveplayerid = ReturnUser(tmp); if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername)); GetPlayerName(playerid, sendername, sizeof(sendername)); reason = bigstrtok(cmdtext, idx); if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /giveitem [playername/id] [item]"); if(reason == "Weapon licence") { AddItemToPlayerInventory(giveplayerid, 10, 1, "Weapon licence"); } } else if(giveplayerid == INVALID_PLAYER_ID) { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, RED, string); } return 1; }
C:\Documents and Settings\Azizo\Bureau\Los Santos Stories Role Play\gamemodes\rpg.pwn(4269) : error 033: array must be indexed (variable "reason")
the line 4269 is :
if(reason == "Weapon licence")
Thanks for your help =)