opengate when admin? - 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: opengate when admin? (
/showthread.php?tid=454455)
opengate when admin? -
Donvalley - 29.07.2013
why isnt this working? it just says You are not a member of E.M.S.
thanks for your time
pawn Код:
stock IsAAdmin(playerid)
{
if(PlayerInfo[playerid][pAdmin] >= 1) return 1;
return 0;
}
command:
pawn Код:
if (strcmp("/opengate", cmdtext, true, 9) == 0)
{
if(!IsAMedic(playerid) || IsAAdmin(playerid)) return SendClientMessage(playerid,COLOR_GREY," You are not a member of E.M.S !");
{
if(PlayerToPoint(10.0,playerid,1611.13476562,-2184.75976562,14.38126087))
{
MoveDynamicObject(FDgate,1616.13476562,-2184.75976562,14.38126087,1.00);
MoveDynamicObject(FDgate2,1600.71289062,-2184.70507812,14.38126087,1.00);
}
else SendClientMessage(playerid, COLOR_RED, "[Error]: {FFFFFF} You're not near any gate!");
}
return 1;
}
Re: opengate when admin? -
SchurmanCQC - 29.07.2013
I'm not sure how your IsAMedic stock works, but here's my code:
pawn Код:
if (strcmp("/opengate", cmdtext, true, 9) == 0)
{
if(IsAMedic(playerid) == 1 || IsAAdmin(playerid) == 1) return SendClientMessage(playerid,COLOR_GREY," You are not a member of E.M.S !");
{
if(PlayerToPoint(10.0,playerid,1611.13476562,-2184.75976562,14.38126087))
{
MoveDynamicObject(FDgate,1616.13476562,-2184.75976562,14.38126087,1.00);
MoveDynamicObject(FDgate2,1600.71289062,-2184.70507812,14.38126087,1.00);
}
else SendClientMessage(playerid, COLOR_RED, "[Error]: {FFFFFF} You're not near any gate!");
}
return 1;
}
I changed if(!IsAMedic(playerid) || IsAAdmin(playerid)) to if(IsAMedic(playerid) == 1 || IsAAdmin(playerid) == 1)
Re: opengate when admin? -
Donvalley - 29.07.2013
sweet, cheers i didn't even think of doing it that way. i need more sleep lol! will +rep you after 24Hours