opengate when admin?
#1

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

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

sweet, cheers i didn't even think of doing it that way. i need more sleep lol! will +rep you after 24Hours
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)