SA-MP Forums Archive
Include a GM in a FS - 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: Include a GM in a FS (/showthread.php?tid=471239)



Include a GM in a FS - Garwan50 - 22.10.2013

Hello !

I created a FS (chase cop event), but my admin system is in my GM, so i cant make that only an admin can launch the event, is there a way to link both ?

Thanks.


Re: Include a GM in a FS - Pottus - 22.10.2013

Yes, you need to create a include for this that will use CallRemoteFunction() for instance say you want to get a players admin level.

step #1 create a public function in the gamemode

pawn Код:
forward GetPlayerLevel(playerid);
public GetPlayerLevel(playerid) return { PlayerData[playerid][p_AdminLevel]; }
step #2 create a include file that defines these functions like so

pawn Код:
#define GetPlayerLevel(%0) CallRemoteFunction("GetPlayerLevel", "i", %0)
step #3 include your new include in your filterscript to use your gamemode functions


Re: Include a GM in a FS - Memoryz - 22.10.2013

SetPVarInt(playerid, "ADMIN_LEVEL", adminlevel); in your gamemode when you load the admin level.

GetPVarInt(playerid, "ADMIN_LEVEL"); in your filterscript to see what their admin level is.


Re: Include a GM in a FS - Pottus - 22.10.2013

Quote:
Originally Posted by Memoryz
Посмотреть сообщение
SetPVarInt(playerid, "ADMIN_LEVEL", adminlevel); in your gamemode when you load the admin level.

GetPVarInt(playerid, "ADMIN_LEVEL"); in your filterscript to see what their admin level is.
You got to be kidding me.... pvars (Pussy vars) are such a bad choice.


Re: Include a GM in a FS - Memoryz - 22.10.2013

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
You got to be kidding me.... pvars (Pussy vars) are such a bad choice.
It allows you to simply and easily create a per-player-variable which is also compatible between gamemodes and filterscripts. I'm not even going to bother wasting time with someone so childish as yourself.


Re : Include a GM in a FS - Garwan50 - 22.10.2013

I used Memoryz's solution because it was the easiest, but thank you it work


Re: Include a GM in a FS - Pottus - 22.10.2013

Quote:
Originally Posted by Memoryz
Посмотреть сообщение
It allows you to simply and easily create a per-player-variable which is also compatible between gamemodes and filterscripts. I'm not even going to bother wasting time with someone so childish as yourself.
I know what it does, but it's a stupid way to do it period, PVars are a terrible design choice because it promotes a lousy coding practice avoid them.

Some more reference.
https://sampforum.blast.hk/showthread.php?tid=268499