SA-MP Forums Archive
Not working - 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: Not working (/showthread.php?tid=136961)



Not working - ColdXX - 27.03.2010

I have this code

pawn Код:
if(strcmp(cmdtext,"/ahq",true)==0)
  {
    if(!IsPlayerAdmin(playerid))
    {
    SetCameraBehindPlayer(playerid);
    ResetPlayerWeapons(playerid);
    SetPlayerHealth(playerid,100);
    SetPlayerArmour(playerid,0);
    SetPlayerPos(playerid,1172.9707,-2036.2747,69.1413);
    SetPlayerFacingAngle(playerid,87.6667);
    SendClientMessage(playerid,COLOR_YELLOW,"..::Admin HQ::..");
    SendClientMessage(playerid,COLOR_AWES,"Welcome to the Admins HQ");
  SendClientMessage(playerid,COLOR_YELLOW,"..::Admin HQ::..");
    }
    else SendClientMessage(playerid,COLOR_RED,"Unknown Command!Type /cmds for commands list!");
    {
    }
    }
    return 1;
    }
But it doesnt work! I mean if im not admin i can teleport!
Wat is wrong?


Re: Not working - Jeffry - 27.03.2010

[pawm]if(IsPlayerAdmin(playerid))[/pawn]




Re: Not working - ColdXX - 27.03.2010

Quote:
Originally Posted by Jeffry
[pawm]if(IsPlayerAdmin(playerid))[/pawn]

No that wont work...that works only if im logged in as RCON...i've also tried that before...someone else?


Re: Not working - jamesbond007 - 27.03.2010

Quote:
Originally Posted by ColdXX
Quote:
Originally Posted by Jeffry
pawn Код:
if(IsPlayerAdmin(playerid))
No that wont work...that works only if im logged in as RCON...i've also tried that before...someone else?
well it certenly wont work with "if(!IsPlayerAdmin(playerid))" because "!" means not.


Re: Not working - ColdXX - 27.03.2010

Quote:
Originally Posted by jamesbond007
Quote:
Originally Posted by ColdXX
Quote:
Originally Posted by Jeffry
pawn Код:
if(IsPlayerAdmin(playerid))
No that wont work...that works only if im logged in as RCON...i've also tried that before...someone else?
well it certenly wont work with "if(!IsPlayerAdmin(playerid))" because "!" means not.
and...how to fix that?