/resetwarnings ? :D - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /resetwarnings ? :D (
/showthread.php?tid=548062)
/resetwarnings ? :D -
SWAT4 - 27.11.2014
Yo Guys

i made a simple admin system
And i made the commands
I have /warn
But i want /resetwarnings (wich will Reset player warnings

)
Can anyone tell me ? i tryed my best but i couldn't do it*
Here is my Warn CMD:
Код:
CMD:warn(playerid, params[])
{
if(pInfo[playerid][pLevel] >= 1)
{
new id,reason[50];
if(sscanf(params, "us[50]", id,reason)) return SendClientMessage(playerid, yellow, "Usage: /warn <Player ID/Part of Name> <Reason>");
//if(id == playerid) return SendClientMessage(playerid, red, "You can not warn yourself!");
if(IsPlayerConnected(id))
{
pInfo[id][Warns]++;
CommandToAdmins(playerid,"warn");
if(pInfo[id][Warns] > 2)
{
format(string,sizeof(string),"Administrator '%s' has kicked '%s' for: %s | Warnings: %d/%d |",GetName(playerid),GetName(id),reason,pInfo[id][Warns],MAX_WARNS);
SendClientMessageToAll(red,string);
Timer[id] = 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,pInfo[id][Warns],MAX_WARNS);
SendClientMessageToAll(red,string);
GameTextForPlayer(id,"~R~Warning ~G~Recived!", 5000, 3);
return 1;
}
else return ShowMessage(playerid, red, 2);
}
else return 0;
}
Re: /resetwarnings ? :D -
HY - 27.11.2014
pawn Код:
CMD:resetwarnings(playerid, params[])
{
new ID;
new string[128];
new name[MAX_PLAYER_NAME];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(pInfo[playerid][pLevel] >= 1)
{
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "Usage: /ResetWarnings [ID]");
pInfo[ID][Warns] = 0;
GetPlayerName(ID, pname, sizeof(pname));
format(string, sizeof(string), "{FFCC33}Admin %s has un-warned %s", name, pname);
SendClientMessageToAll(-1, string);
format(string, sizeof(string), "{FFCC33}Admin %s has un-warned you!", name);
SendClientMessage(ID, -1, string);
format(string, sizeof(string), "{FFCC33}You have un-warned %s!", pname);
SendClientMessage(playerid, -1, string);
}
return 1;
}
Not very optimized, but you can optimize it. I didn't have much time.
Re: /resetwarnings ? :D -
SWAT4 - 27.11.2014
Thanks!