22.07.2012, 04:39
tenta
procurei e achei isso ae tenta deve funciona
creditos a Rjjj
pawn Код:
//No Topo do GM:
new Comandos[MAX_PLAYERS][20];
new FloodComandos[MAX_PLAYERS];
//No comeзo do OnPlayerCommandText:
new ComandoAtual[20];
new Parametro;
ComandoAtual = strtok(cmdtext, Parametro);
if(!strcmp(ComandoAtual, Comandos[playerid], true) && strlen(Comandos[playerid]))
{
FloodComandos[playerid]++;
SendClientMessage(playerid, 0x33CCFFAA, "Proibido flood em comandos !");
if(FloodComandos[playerid] == 3)
{
Comandos[playerid] = ("");
FloodComandos[playerid] = 0;
new STR[65];
new NickName[MAX_PLAYER_NAME];
GetPlayerName(playerid, NickName, MAX_PLAYER_NAME);
format(STR, 65, "%s Foi kickado por floodar nos comandos!", NickName);
SendClientMessageToAll(0xFF0000AA, STR);
Kick(playerid);
}
return 1;
}
else
{
FloodComandos[playerid] = 0;
}
format(Comandos[playerid], 20, "%s", ComandoAtual);
//E, se a funзгo strtok nгo estiver declarada, no Final do GM:
stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
creditos a Rjjj