SA-MP Forums Archive
How to import admin functions from a filterscript into gamemode - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to import admin functions from a filterscript into gamemode (/showthread.php?tid=170267)



How to import admin functions from a filterscript into gamemode - Stryke - 22.08.2010

Im trying to make automatic gates open only if an admin approaches them. The issue is that the admin system im using is Xtreme's admin system which im running as a filterscript, this admins system also uses levels and im just wondering how i would make it so that the gates would open for a level 10 admin. The function is something like IsPlayerXAdmin but the gamemode wont be able to define that will it?


Re: How to import admin functions from a filterscript into gamemode - pmk1 - 22.08.2010

just put your gates script in your admin system, so then it will be defined!


Re: How to import admin functions from a filterscript into gamemode - Stryke - 22.08.2010

I didnt think of that that sounds the logical thing to do but would it not complicate things?


Re: How to import admin functions from a filterscript into gamemode - ZeRo_HUN - 22.08.2010

It works perfectly, you just have to define your gate object ID, and create a new timer. It wont complicate things.


Re: How to import admin functions from a filterscript into gamemode - Stryke - 22.08.2010

So what would I put around the within the gate function then?

IsPlayerXAdmin...

im struggling to do it because this admin system has levels


Re: How to import admin functions from a filterscript into gamemode - pmk1 - 22.08.2010

i dont know your admin system but im sure it's somehting like this:

if (IsPlayerXAdmin(playerid, 10) // 10 is the level, but as i said, i don't know how your admin system check player's level
{
//your gates stuff
}
else
{
SendClientMessage(playerid, COLOR_RED, "Only Level 10 Admins Can Go Through The Gates");
}


Re: How to import admin functions from a filterscript into gamemode - Stryke - 22.08.2010

Quote:
Originally Posted by pmk1
Посмотреть сообщение
i dont know your admin system but im sure it's somehting like this:

if (IsPlayerXAdmin(playerid, 10) // 10 is the level, but as i said, i don't know how your admin system check player's level
{
//your gates stuff
}
else
{
SendClientMessage(playerid, COLOR_RED, "Only Level 10 Admins Can Go Through The Gates");
}
Well if it makes any difference its Xtreme's Admin system (if you know how that works) but ill try what you pasted above now.
Thanks for helping me out


Re: How to import admin functions from a filterscript into gamemode - Stryke - 22.08.2010

When i try add the IsPlayerXAdmin function it comes up with errors saying playerid is not defined, i dont understand why its doing this, playerid is used throughout the script
Sorry for double posting


Re: How to import admin functions from a filterscript into gamemode - pmk1 - 22.08.2010

but where have you put these lines?


Re: How to import admin functions from a filterscript into gamemode - Stryke - 22.08.2010

i put them within the gatecheck function

the code im trying to restrict to admins only is

pawn Код:
public GateCheck()
{
    new admingate1Open;
    for(new playerid; playerid<MAX_PLAYERS; playerid++)
{
    if(IsPlayerInRangeOfPoint(playerid,15.0,2220.3957,-1139.3205,25.6949))admingate1Open=1;
}
    //AdminGate Los Santos
    if(admingate1Open)MoveObject(admingate1,2227.763428, -1146.743164, 26.401253, 3); //These are the coordinates of the gate if it were in it's opened state.
    else MoveObject(admingate1,2220.218018, -1144.315796, 26.401253, 3);//These are the coordinates of the gate if it were in it's closed state.
}



Re: How to import admin functions from a filterscript into gamemode - pmk1 - 22.08.2010

playerid isn't defined because your public GatCheck() should be like this:

public GateCheck(playerid)


Re: How to import admin functions from a filterscript into gamemode - Stryke - 22.08.2010

It didnt work like that all i did was

IF (IsPlayerXAdmin (playerid))

//rest of stuff here

and it worked.

Thanks for your help if it wasnt for you i would still be barking up the wrong tree trying to mess around with it. Thanks


Re: How to import admin functions from a filterscript into gamemode - pmk1 - 22.08.2010

haha np :P