23.07.2013, 13:12
Quote:
C:\Users\aspire\Desktop\FIN-GTA\gamemodes\None.pwn(17523) : error 033: array must be indexed (variable "color") |
Quote:
if(strcmp(cmd, "/lasertoy", true) == 0) { new tmp2[128],slot,color[32], string2[128]; tmp2 = strtok(cmdtext, idx); if(!strlen(tmp2)) { SendClientMessage(playerid, 0xFFFFFFAA,"[USAGE] /lasertoy [playerid] [slot][color]"); return 1; } giveplayerid = strval(tmp2); tmp2 = strtok(cmdtext, idx); if(!strlen(tmp2)) { SendClientMessage(playerid, 0xFFFFFFAA,"[USAGE] /lasertoy [playerid] [slot][color]"); return 1; } slot = strval(tmp2); tmp2 = strtok(cmdtext, idx); if(!strlen(tmp2)) { SendClientMessage(playerid, 0xFFFFFFAA,"[USAGE] /lasertoy [playerid] [slot][color]"); return 1; } color = strval(tmp2); if (IsPlayerConnected(giveplayerid)) { if(strcmp(color,"red",true) == 0) { PlayerToyInfo[giveplayerid][slot][ptModelID] = 18643; PlayerToyInfo[giveplayerid][slot][ptBone] = 6; PlayerToyInfo[giveplayerid][slot][ptPosX] = 0.0; PlayerToyInfo[giveplayerid][slot][ptPosY] = 0.0; PlayerToyInfo[giveplayerid][slot][ptPosZ] = 0.0; PlayerToyInfo[giveplayerid][slot][ptRotX] = 0.0; PlayerToyInfo[giveplayerid][slot][ptRotY] = 0.0; PlayerToyInfo[giveplayerid][slot][ptRotZ] = 0.0; } else if(strcmp(color,"green",true) == 0) { PlayerToyInfo[giveplayerid][slot][ptModelID] = 19083; PlayerToyInfo[giveplayerid][slot][ptBone] = 6; PlayerToyInfo[giveplayerid][slot][ptPosX] = 0.0; PlayerToyInfo[giveplayerid][slot][ptPosY] = 0.0; PlayerToyInfo[giveplayerid][slot][ptPosZ] = 0.0; PlayerToyInfo[giveplayerid][slot][ptRotX] = 0.0; PlayerToyInfo[giveplayerid][slot][ptRotY] = 0.0; PlayerToyInfo[giveplayerid][slot][ptRotZ] = 0.0; } } else { format(string2, sizeof(string2), "<ERROR> %d is not connected!", giveplayerid); SendClientMessage(playerid, COLOR_RED, string2); } return 1; } |