An admin gate - 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: An admin gate (
/showthread.php?tid=390335)
An admin gate -
x96664 - 05.11.2012
Hi, I was trying to do something but I got troubled. So I'm making a moving gate (with command) and I want to be opened only by RCON admins and also to use PlaySoundForPlayersInRange (with sound 1035 while the gate is being opened and when it opens to finish with sound 1036). Here is my code:
pawn Код:
if (strcmp("/adminelevator", cmdtext, true, 10) == 0)
{
if(CheckEGate == 0)
{
SendClientMessage(playerid,-1,"Gate is opened now!");
MoveObject(EGate, 1788.30004883,-1297.50000000,9.60000038, 2.0);
CheckEGate = 1;
}
else
{
SendClientMessage(playerid,-1,"Gate is closed now!");
MoveObject(EGate, 1788.29980469,-1297.50000000,14.30000019, 2.0);
CheckEGate = 0;
}
return 1;
}
Re: An admin gate -
Private200 - 05.11.2012
pawn Код:
public OnRconCommand(cmd[])
{
if(!strcmp(cmd,"adminelevator",true))
{
if(CheckEGate == 0)
{
SendClientMessage(playerid,-1,"Gate is opened now!");
MoveObject(EGate, 1788.30004883,-1297.50000000,9.60000038, 2.0);
CheckEGate = 1;
}
else
{
SendClientMessage(playerid,-1,"Gate is closed now!");
MoveObject(EGate, 1788.29980469,-1297.50000000,14.30000019, 2.0);
CheckEGate = 0;
}
return 1;
}
IDK about the PlaySoundForPlayerInRange but i can only help you with this one
Hope it works
Re: An admin gate -
x96664 - 05.11.2012
Quote:
Originally Posted by Private200
pawn Код:
public OnRconCommand(cmd[]) { if(!strcmp(cmd,"adminelevator",true)) { if(CheckEGate == 0) { SendClientMessage(playerid,-1,"Gate is opened now!"); MoveObject(EGate, 1788.30004883,-1297.50000000,9.60000038, 2.0); CheckEGate = 1; } else { SendClientMessage(playerid,-1,"Gate is closed now!"); MoveObject(EGate, 1788.29980469,-1297.50000000,14.30000019, 2.0); CheckEGate = 0; } return 1; }
IDK about the PlaySoundForPlayerInRange but i can only help you with this one
Hope it works
|
2x :
Код:
error 017: undefined symbol "playerid"
Re: An admin gate -
x96664 - 05.11.2012
I thought about if(!IsPlayerAdmin)) and message for that the normal players don't have permission to open the gate.