12.10.2015, 22:12
Pues, tengo el simple comando para colocarse un estado, con este se coloca un texto arriba de la cabeza, pues al relogear ya no lo tienes, entonces le coloquй un guardado pero en el comando para que guarde el estado, asн lo coloquй en una parte del comando "PlayerInfo[playerid][pEstado] = result;" y me tira "error 006: must be assigned to an array"
Код:
if(strcmp(cmd, "/estado", true) == 0) //Indicar un estado del personaje IC { if(PlayerInfo[playerid][pNivel] < 1) return SendClientMessage(playerid,Rojo,"* Necesitas ser nivel 5 para usar este comando."); if(IsPlayerConnected(playerid)) { new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')){idx++;} new offset = idx; new result[80]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))){result[idx - offset] = cmdtext[idx]; idx++;} result[idx - offset] = EOS; if(!strlen(result) && Yo[playerid] != 0) { SendClientMessage(playerid, Naranja, "* /Estado [Texto]"); format(string, sizeof(string), "Estado actual: * %s *", YoTexto[playerid]); SendClientMessage(playerid, Naranja, string); return 1; } if(!strlen(result)) { SendClientMessage(playerid, Naranja, "* /Estado [Texto]"); return 1; } new Float:X, Float:Y, Float:Z; GetPlayerPos(playerid, X, Y, Z); DestroyDynamic3DTextLabel(Yo3DText[playerid]); format(YoTexto[playerid], sizeof(result), result); Yo3DText[playerid] = CreateDynamic3DTextLabel(YoTexto[playerid], Rojo, X, Y, (Z + 20.0), 20.0, playerid); Streamer_Update(playerid); format(string, sizeof(string), "Estado actual: * %s *", result); SendClientMessage(playerid, Morado, string); PlayerInfo[playerid][pEstado] = result; // ACБ LA LINEA DEL ERROR. SendClientMessage(playerid, Naranja, "* Utiliza /Estadoq para quitбrtelo."); Yo[playerid] = 1; } return 1; }