08.09.2016, 19:27
Hello, I have some questions:
1. What i need to change this cmd ? I want to receive automatically kick the player who have 3 warns? I tried to do this alone but when a player has 3 warns not receive automatically kick
CMD:
I have a problem with this command:
IMAGE
How can fix that?
CMD:
Sorry for my bad english
1. What i need to change this cmd ? I want to receive automatically kick the player who have 3 warns? I tried to do this alone but when a player has 3 warns not receive automatically kick
CMD:
Код:
CMD:warn(playerid, params[])
{
if(pData[playerid][pAdmin] >= 1)
{
new id,reason[50],string[100];
if(sscanf(params, "us[50]", id,reason)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /warn <Player ID/Part of Name> <Reason>");
if(pData[playerid][Warns] == MAX_WARNS)
{
Kick(id);
}
if(IsPlayerConnected(id))
{
pData[id][Warns]++;
if(pData[id][Warns] > 2)
{
format(string,sizeof(string),"Administrator '%s' has kicked '%s' for %s | Warnings: %d/%d |",GetName(playerid),GetName(id),reason,pData[id][Warns],MAX_WARNS);
SendClientMessageToAll(COLOR_RED,string);
SetTimerEx("KickPlayer",200,false,"d", id);
return 1;
}
format(string,sizeof(string),"Administrator '%s' has given '%s' a Warning | Reason: %s |Warnings: %d/%d|",GetName(playerid),GetName(id),reason,pData[id][Warns],MAX_WARNS);
SendClientMessageToAll(COLOR_RED,string);
GameTextForPlayer(id,"~R~Warning", 5000, 3);
return 1;
}
else return SendClientMessage(playerid,COLOR_RED,"Acest player nu este conectat");
}
else return SendClientMessage(playerid,COLOR_RED,"Nu esti admin");
}
IMAGE
How can fix that?
CMD:
Код:
CMD:warned(playerid,params[])
{
if(pData[playerid][pAdmin] >= 1)
{
new Count = 0,string[100];
strdel(string,0,500);
foreach(Player, i)
{
if (pData[i][Warns] >= 1)
{
format(string, 128, "%s(ID: %d) | Warnings (%d/%d)\n",GetName(i),i,pData[i][Warns],MAX_WARNS);
strcat(string, string, sizeof(string));
Count++;
}
}
else (Count == 0)
ShowPlayerDialog(playerid,WARNLOG+165,DIALOG_STYLE_MSGBOX,"{00FFE6}Warned Players","{FF0000}No one is Warned!" ,"OK","");
else
{
if(Count == 1) ShowPlayerDialog(playerid,WARNLOG+165,DIALOG_STYLE_MSGBOX,"{00FFE6}1 player is Warned",string ,"OK","");
else format(string, 128, "{00FFE6}%d players are Warned",Count), ShowPlayerDialog(playerid,WARNLOG+165,DIALOG_STYLE_MSGBOX,string,string ,"OK","");
}
strdel(string,0,500);
return 1;
}
else return SendClientMessage(playerid,COLOR_RED,"Nu esti admin");
}
Sorry for my bad english

