SA-MP Forums Archive
Remove PermaDisable - 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: Remove PermaDisable (/showthread.php?tid=632216)



Remove PermaDisable - JuzDoiT - 10.04.2017

remove perma disable when player is offline ..

here is the command for perma disable
Quote:

CMD:apermdisable(playerid, params[])
{
new TargetID,Reason[128],str2[128];
if(LoginCheck[playerid] == 0) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(PlayerInfo[playerid][pAdminLevel] < 5) return SendClientMessage(playerid, COLOR_RED, ""ERROR_MESSAGE"");
if(sscanf(params, "uS(No Reason Given)[128]", TargetID, Reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /apermdisable (Name / ID) (Reason)");
if(TargetID == INVALID_PLAYER_ID || !IsPlayerConnected(TargetID)) return SendClientMessage(playerid, COLOR_RED, ""CONNECTION_ERROR"");
if(PlayerInfo[TargetID][pAdminLevel] >= PlayerInfo[playerid][pAdminLevel]) return SendClientMessage(playerid, COLOR_RED, ""ADMIN_ERROR"");
else
{
new str1[128];
format(str1,sizeof(str1),"***KICK: %s (%d) (PERMANENT DISABLE) %s",pname(TargetID),TargetID,Reason);
SendClientMessageToServer(TargetID,COLOR_ADMIN,str 1);
format(str2,sizeof(str2),"You Have Been Permanently Disabled By An Admin. Reason: %s",Reason);
SendClientMessage(TargetID,COLOR_ADMIN,str2);
PlayerInfo[TargetID][PermDisable] =1;
SetTimerEx("kick", KICKTIMER, false, "i", TargetID);
AdminMsg(playerid, "apermdisable");
}
return 1;
}




Re: Remove PermaDisable - AndreiWow - 10.04.2017

What are you trying to do because I dont understand?
Just put

PlayerInfo[TargetID][PermDisable] =0;

under OnPlayerDisconnect if you want it to reset when he leaves


Re: Remove PermaDisable - Kane - 11.04.2017

Command makes no sense. How're they permanently disabled if they're just being kicked then the "perm disabled" being reset when they disconnect (even though they're being kicked).

What exactly are you trying to do?