CMD:rwarn(playerid,params[])
{
if(pInfo[playerid][pAdminLevel] >= 4 || IsPlayerAdmin(playerid))
{
new targetid,reason[105],string[256];
if(sscanf(params, "us[105]", targetid, reason)) return SendClientMessage(playerid,-1,""chat" /rwarn [playerid] [reason]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid,-1,""chat" Player is not online");
new sentstring[128];
pInfo[targetid][pWarnings]--;
format(string,sizeof(string), "%s %s has removed your warning\nReason: %s\nRemoved Warning Number: %i",GetAdminName(playerid),PlayerName(playerid), reason, pInfo[targetid][pWarnings]);
ShowPlayerDialog(targetid,DIALOG_WARN,DIALOG_STYLE_MSGBOX,"Good News",string,"Ok, Dude","");
format(sentstring,sizeof(sentstring), ""chat""COL_LIGHTBLUE" %s %s has removed warning of %s Reason: %s (%i / 3)",GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid),reason,pInfo[targetid][pWarnings]);
SendClientMessageToAll(-1,sentstring);
if(pInfo[targetid][pWarnings] >= 100)
{
format(string, sizeof(string), ""chat""COL_LIGHTBLUE" %s %s has kicked %s [Reason: %s][100 Warnings EXCEEDED]",GetAdminName(playerid),PlayerName(playerid),PlayerName(targetid),reason);
SendClientMessageToAll(-1,string);
Kick(targetid);
}
}
else {
SendClientMessage(playerid,-1,""chat""COL_LIGHTBLUE" You do not have the right admin permissions for this command!");
}
return 1;
}
|
STOP POSTING THIS USELESS STUFF!!
CAN THIS CODE EVEN COMPILE?! SERIOUSLY... |
!
|
STOP POSTING THIS USELESS STUFF!!
CAN THIS CODE EVEN COMPILE?! SERIOUSLY... |
pInfo[playerid][pAdminLevel]
#define ADMIN(%0) the_array_itself[%0][pAdminLevel]
if(ADMIN(playerid) == 5235) {
|
suggestion:
make a define for arrays which should be edited and matched with the gamemode's arrays,for example: Code:
pInfo[playerid][pAdminLevel] Code:
#define ADMIN(%0) the_array_itself[%0][pAdminLevel]
if(ADMIN(playerid) == 5235) {
|
|
How about I just spam the board by posting a command from my gamemode? Seriously, stop this.
|