How to import admin functions from a filterscript into gamemode
#1

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

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

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

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

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

IsPlayerXAdmin...

im struggling to do it because this admin system has levels
Reply
#6

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");
}
Reply
#7

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

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

but where have you put these lines?
Reply
#10

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.
}
Reply
#11

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

public GateCheck(playerid)
Reply
#12

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

haha np :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)