Onplayerupdate - 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: Onplayerupdate (
/showthread.php?tid=391529)
Onplayerupdate -
Tamer - 10.11.2012
Aight,I got playerupdate checking for miniguns,but I have done a cmd that makes the players HasMG =1 and gives a minigun,which will exclude from the ban spree. I know its about if clause and "and"s but couldn't get in to it. I asked a friend he told me a bunch of stuff but still dunno how to do it.
I just want it not to ban if the player is HasMG[playerid] = 1; and If player is an admin lvl 4.
Код:
public OnPlayerUpdate(playerid)
{
new weapon=GetPlayerWeapon(playerid);
if(weapon==38||weapon==1||weapon==2||weapon==3||weapon==5||weapon==6||weapon==7||weapon==8||weapon==9||weapon==10||weapon==11||weapon==12||weapon==13||weapon==14||weapon==15||weapon==35||weapon==39)
if(PlayerInfo[playerid][pAdmin] < 4)
HasMG[playerid] = 0;
{
Re: Onplayerupdate -
JJones432 - 10.11.2012
The first time you set it, it stays the same as you are setting the variable to 1.
Having this many checks for something which has already been defined is kinda pointless. So if you have HasMG[playerid] = 1; on your command, you don't need to set it again
Also, on your Ban check, just add the line
if(PlayerInfo[playerid][pAdmin] != 4) return 0;
Re: Onplayerupdate -
Tamer - 10.11.2012
It is working well with Padmin=4 aldready, I want it NOT to ban if the player HasMG= 1;
Re: Onplayerupdate -
Finn - 10.11.2012
if(PlayerInfo[playerid][pAdmin] < 4 && HasMG[playerid] != 1)