if(strcmp(cmd, "/duda", true) == 0) { if(IsPlayerConnected(playerid)) { if ((!nod) && duda[playerid] > 0) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USO: /Duda [Texto]"); return 1; } if(PlayerInfo[playerid][pLevel] > 2) { duda[playerid] -= 1; } format(string, sizeof(string), "Pregunta de %s(ID:%d): %s.", sendername, playerid, (result)); ABroadCast(COLOR_ASKQ,string,1); format(string, sizeof(string), "Tu pregunta fue enviada a los admins. Te quedan %d dudas restantes.", duda[playerid]); SendClientMessage(playerid, COLOR_ASKQ, string); } else { SendClientMessage(playerid, COLOR_GRAD2, "El canal de dudas ha sido desactivado debido al mal uso del mismo."); } } return 1; }
if(strcmp(cmd, "/ooc", true) == 0 || strcmp(cmd, "/o", true) == 0) { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " No Estбs Conectado"); return 1; } if ((noooc) && PlayerInfo[playerid][pAdmin] < 1) { SendClientMessage(playerid, COLOR_GRAD2, "Chat de Dudas/Preguntas, Desactivado!"); return 1; } if(PlayerInfo[playerid][pMuted] == 1) { SendClientMessage(playerid, TEAM_CYAN_COLOR, "Estas Silenciado."); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "Utiliza: /O(OOC): [Pregunta/Duda]"); return 1; } if(PlayerInfo[playerid][pAdmin] == 1 || PlayerInfo[playerid][pAdmin] == 2 || PlayerInfo[playerid][pAdmin] == 3) { format(string, sizeof(string),"(( Moderador [ID: %d] %s: %s ))",playerid, sendername, result); OOCOff(COLOR_LIGHTBLUE,string); printf("%s",string); } if(PlayerInfo[playerid][pAdmin] >= 4 && PlayerInfo[playerid][pAdmin] < 1330) { format(string, sizeof(string),"(( Administrador [ID: %d] %s: %s ))",playerid, sendername, result); OOCOff(COLOR_LIGHTBLUE,string); printf("%s",string); } if(PlayerInfo[playerid][pAdmin] == 1338 || PlayerInfo[playerid][pAdmin] == 2012) { format(string, sizeof(string),"(( Admin Dueсo [ID: %d] %s: %s ))",playerid, sendername, result); OOCOff(0xF77E06FF,string); printf("%s",string); } if(PlayerInfo[playerid][pAdmin] < 1) { format(string, sizeof(string), "(( [Ayuda][ID: %d] %s: %s ))",playerid, sendername, result); OOCOff(COLOR_LIGHTBLUE,string); printf("%s", string); } } return 1; }
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
Daa, ahora esta bien c soluciono el tema /duda /o, aora se reinicia cuando entro el 8є user
AYUDA!!! |