Include a GM in a FS
#1

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.
Reply
#2

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
Reply
#3

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.
Reply
#4

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.
Reply
#5

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.
Reply
#6

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)