09.06.2011, 18:00
pawn Код:
#pragma unused ret_memcpy
new VehicleName[MAX_VEHICLE_NAME];
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/aviso", true) == 0) {
new string[256];
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(IsPlayerAdmin(playerid)){
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Digite: /aviso [id] [motivo]");
return 1;
}
plid = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
if(IsPlayerConnected(plid)){
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, Vermelho, "{FFFF00}[{E60000} ERRO {FFFF00}]{FFFFFF} Vocк sу pode avisar com uma razгo apropriada!");
}else{
aviso[plid]+=1;
if(aviso[plid]>= 3){
format(string, sizeof(string), "* [ Zй_Ninguem(bot) ] kickou o jogador %s (Motivo: limite de avisos)",pname);
SendClientMessageToAll(tcadm, string);
SetPlayerPos(plid, 831.9581,-1102.1510,24.2969);
GameTextForPlayer(plid,"~r~kickado~w~!", 2500, 3);
Kick(plid);
}
format(string, sizeof(string), "* O Administrador %s avisou o jogador: %s. (Motivo: %s - (%d/3)", aname,pname,result,aviso[plid]);
SendClientMessageToAll(tcadm, string);
}
}else{
format(string, sizeof(string), "{FFFF00}[{E60000} ERRO {FFFF00}]{FFFFFF} ID %d nгo й valido.", plid);
SendClientMessage(playerid, Vermelho, string);
}
}
return 1;
}