23.08.2013, 10:43
hm.. troca esses seus comandos para zcmd e sscanf que fica bem mais facil!
Usa este /relatorio como exemplo:
Usa este /relatorio como exemplo:
pawn Код:
if(strcmp(cmd, "/relatorio", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new sendername[MAX_PLAYER_NAME]
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[800];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, -1, "Uso Correto: /Relatуrio [Texto]");
return 0x01;
}
if(VARIAVEL PLAYER NORMAL)
{
format(string, sizeof(string), "[Relatуrio][%d] %s: %s",playerid, sendername, (result));
SendClientMessageToAll(0xFFFF00FF,string);
}
if(VARIAVEL PLAYER VIP)
{
format(string, sizeof(string), "[Relatуrio][%d] %s: %s",playerid, sendername, (result));
SendClientMessageToAll(0x057ABDAA,string);
}
if(VARIAVEL PLAYER SOCIO)
{
format(string, sizeof(string), "[Relatуrio][%d] %s: %s",playerid, sendername, (result));
SendClientMessageToAll(0xFF0000FF,string);
}
}
return 0x01;
}