06.11.2011, 21:10
Prueba de esta forma:
Avisame si te funciona.
Код:
zcmd(acento, playerid, params[]){ new cmd[500], idx; cdm = strtok(params, idx); if(IsPlayerConnected(playerid)) { new length = strlen(params); while ((idx < length) && (params[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = params[idx]; idx++; } result[idx - offset] = EOS; if(length > 28) return SendClientMessage(playerid, COLOR_GREY, "Acento demaciado largo"); if(!strlen(result)) return SendClientMessage(playerid, COLOR_WHITE, "USE: /Acento [Lenguaje]"); if(!strcmp(result, "Ninguno", true)) { strmid(PlayerInfo[playerid][pAccent], "Ninguno", 0, strlen("Ninguno"), 255); format(string, sizeof(string), "Acento desactivado"); SendClientMessage(playerid, 0x25affeAA, string); return 1; } strmid(PlayerInfo[playerid][pAccent], result, 0, strlen(result), 255); format(string, sizeof(string), "Acento cambiado [Acento %s]",PlayerInfo[playerid][pAccent]); SendClientMessage(playerid, 0x25affeAA, string); SendClientMessage(playerid, COLOR_WHITE, "Para poder desactivar el acento /Acento Ninguno"); } } return 1; }