Help with /og and /cg - 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: Help with /og and /cg (
/showthread.php?tid=503984)
Help with /og and /cg -
Jacob756 - 01.04.2014
Hello everyone,
i have a gang map with a movable gate,
i made the command to move it up and down which is /cg and /og
but i have decided to make it an admin base
when i try to open the gate it says "you are not an admin" thats because I have the code like this
Код:
if(!strcmp(cmdtext,"/og",true))
{
if(IsPlayerAdmin(playerid)){
new string[50];
new movetime = MoveObject(gate, 2101.30786, 15.75350, -5.72150, 2.00);
SendClientMessage(playerid, 0xDEEE20FF, "gate opening.");
}
else SendClientMessage(playerid, 0xDEEE20FF, "You are not an admin to move the gate.");
}
its only for RCON admins but i want it from admin level 1 to 10
can anybody help me plz
Re: Help with /og and /cg -
ZeroTheScyther - 01.04.2014
Well ... how do you store the admin level? Mine is stored like
pawn Код:
PlayerInfo[playerid][pLevel]
and you should just change
pawn Код:
if(IsPlayerAdmin(playerid))
with your "variable" ... in my case being
pawn Код:
PlayerInfo[playerid][pLevel]
and add
meaning "If pLevel is higher than 0"
and the code would look like
pawn Код:
if(!strcmp(cmdtext,"/og",true))
{
if(PlayerInfo[playerid][pLevel] > 0){
new string[50];
new movetime = MoveObject(gate, 2101.30786, 15.75350, -5.72150, 2.00);
SendClientMessage(playerid, 0xDEEE20FF, "gate opening.");
}
else SendClientMessage(playerid, 0xDEEE20FF, "You are not an admin to move the gate.");
}