03.02.2013, 21:38
Tente Agora...
Final do GM/FS
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
cmd = strtok(cmdtext, idx);
// - Comeзo dos Comandos - //
if(strcmp(cmd, "/kick", true) == 0)
{
new aname[MAX_PLAYERS_NAME], file[40];
GetPlayerName(playerid,aname,MAX_PLAYERS_NAME);
format(file,sizeof(file),CONTAS,aname);
if(pAdmin[playerid] != 1) return false;
strmid(tmp,cmdtext, 2,strlen(cmdtext));
if(!srlen(tmp)) return SendClientMessage(playerid,Vermelho,"Digite: /Kick [ID DO PLAYER]);
format(string,sizeof(string), "|ADMIN-CMD| O Administrador %s Kikcou o Jogador %!" aname,tmp);
SendClientMessage,playerid,azul" |ERRO| Vocк nгo tem Permissгo para Executar este Comando!");
}
return 1;
}
PHP код:
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;
}