SA-MP Forums Archive
HELP please ! - 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: HELP please ! (/showthread.php?tid=156467)



HELP please ! - Danielo - 22.06.2010

Код:
	
    // Gates for Faction number 2 !
    if(PlayerInfo[giveplayerid][pFaction] == 2)
    if(strcmp(cmd, "/opengate", true) == 0)
	{
		GateOpened[playerid] = 1;
		MoveObject(GATE,1041.09314000,-1462.33178700,12.73088500,2.0);
		return 1;
	}
    if(PlayerInfo[giveplayerid][pFaction] == 2)
	if(strcmp(cmd, "/closegate", true) == 0)
	{
		if(GateOpened[playerid] == 1)
		{
      GateOpened[playerid] = 0;
			MoveObject(GATE,1040.98095700,-1455.91210900,12.80246400,2.0);
		}
		else
		{
			SendClientMessage(playerid,COLOR_RED,"The gate isnt opened !");
		}
		return 1;
	}
Is that right ?
I mean the gates can be opened only by Faction ID 2 !!??


Re: HELP please ! - mprofitt - 22.06.2010

Won't work. Try again.


Re: HELP please ! - Ihsan_Cingisiz - 22.06.2010

sORRY WRONG SECTION


Re: HELP please ! - Danielo - 22.06.2010

Quote:
Originally Posted by mprofitt
Won't work. Try again.
IF you do that for +1 ,please dont post..i just ask for help ! i mean if could someone fix it !


Re: HELP please ! - Anthony_Brassi - 22.06.2010

First off, GateOpen[playerid] means its limited to one person, meaning they'll have to /gateopen then /gateclose again, otherwise it would say the gate Isn't opened, So lets change it from GateOpen[MAX_PLAYERS]
to Gateopen;

pawn Код:
// at top of script
new GateOpen;

    if(strcmp(cmd, "/closegate", true) == 0)
    {
        if(PlayerInfo[giveplayerid][pFaction] == 2)
        {
        if(GateOpened == 1)
        {
        GateOpened[playerid] = 0;
        MoveObject(GATE,1040.98095700,-1455.91210900,12.80246400,2.0);
        }
     }