HELP please !
#1

Код:
	
    // 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 !!??
Reply
#2

Won't work. Try again.
Reply
#3

sORRY WRONG SECTION
Reply
#4

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 !
Reply
#5

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);
        }
     }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)