SA-MP Forums Archive
I need script for moving gate for gang members. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: I need script for moving gate for gang members. (/showthread.php?tid=415146)



I need script for moving gate for gang members. - BloodRaven - 11.02.2013

Hello there,
I have Raven's Roleplay gamemode and i need a script to open a gang gate. I mean that only gang members can open/close the gate. Please help me i need fast help.


Re: I need script for moving gate for gang members. - BloodRaven - 12.02.2013

Bump


Re: I need script for moving gate for gang members. - Jstylezzz - 12.02.2013

something like this, it's really basic:
pawn Код:
CMD:gate(playerid,params[])
{
if(PInfo[playerid][Gang] != 1) return SendClientMessage(playerid,COLOR_RED,"You are not in gang number 1");
MoveObject(gate,x,y,z,3.0);
SendClientMessage(playerid,COLOR_GREEN,"Gate opened");
return 1;
}
The line where it checks if the player is in the gang, is the thing you need.

EDIT: you should post this in the Scripting Help section next time, I guess a mod will move this there anyways, but remember to post scripting questions there.


Re: I need script for moving gate for gang members. - BloodRaven - 12.02.2013

I got that problem with the compile:
pawn Код:
C:\Users\Stefanos\Desktop\RP\filterscripts\drop.pwn(208) : error 017: undefined symbol "PInfo"
C:\Users\Stefanos\Desktop\RP\filterscripts\drop.pwn(208) : warning 215: expression has no effect
C:\Users\Stefanos\Desktop\RP\filterscripts\drop.pwn(208) : error 001: expected token: ";", but found "]"
C:\Users\Stefanos\Desktop\RP\filterscripts\drop.pwn(208) : error 029: invalid expression, assumed zero
C:\Users\Stefanos\Desktop\RP\filterscripts\drop.pwn(208) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
and this is my script:
pawn Код:
{
    if(IsPlayerInRangeOfPoint(playerid,8,1285.0999755859, -2056.1000976563, 61.700000762939))
    {
if(PInfo[playerid][Gang] != 15) return SendClientMessage(playerid,COLOR_RED,"You are not in gang number 15");
    MoveObject(autogate,1285.0999755859, -2056.1000976563, 53.5,3);
    SetTimer("close",4000,0);
    return 1;
    }
    return 1;
}



Re: I need script for moving gate for gang members. - Jstylezzz - 12.02.2013

You don't have to exactly copy my code, it's just an example.
If you restore the gate command, and post it here, I can take a look.
Also, please tell me where the player variables are stored (Pinfo, Playerinfo, something like that)


Re: I need script for moving gate for gang members. - Astralis - 12.02.2013

define PInfo.


Re: I need script for moving gate for gang members. - Jstylezzz - 12.02.2013

He has ravens roleplay, as stated in the top post.
In ravens roleplay, the player variables are already defined, so defining PInfo won't do anything more than take away the errors.
Like that it won't work in any way.


Re: I need script for moving gate for gang members. - BloodRaven - 12.02.2013

you can join via teamviewer if you can to see what you want.