Can Someone Please Tell Me What Is Wrong With This?
#1

Can Someone Please Tell Me What Is Wrong With This?

Код:
new gate;

forward CloseGate();
Код:
public CloseGate()
{
  MoveObject(gate,1811.58, -1889.38, 14.20, 2);
}
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/gate", cmdtext, true, 10) == 0)
	{
		if (IsPlayerInRangeOfPoint(playerid, 10, 1811.58, -1889.38, 14.20))
 		{
			if (IsPlayerInVehicle(playerid,420))
			{
 				SendClientMessage(playerid,0xFF0000FF,"Gate Will Close In 10 Seconds");
  				MoveObject(gate,1811.58, -1898.38, 14.20, 2);
	  		SetTimer("CloseGate", 10000, false);
			}
		}
	}
	return 1;
}
Reply
#2

Nothing looks wrong - Whats the problem!!!
Reply
#3

the gate dosent move lol :P

i did tests and it knows im close enough but it dosent find player being in vehicleid 420(and it is true lol :P)

do you know what i mean?
Reply
#4

I think the problem is in this bit
Код:
if (IsPlayerInVehicle(playerid,420))
			{
 				SendClientMessage(playerid,0xFF0000FF,"Gate Will Close In 10 Seconds");
  				MoveObject(gate,1811.58, -1898.38, 14.20, 2);
	  		SetTimer("CloseGate", 10000, false);
			}
Reply
#5

The 420 should probably be the vehicle id, not the model id.
Reply
#6

oh of corse thankyou
Reply
#7

GetVehicleModel(GetPlayerVehicleID(playerid)) == 420
Reply
#8

Quote:
Originally Posted by Thrarod
pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 420)
Just like this.
Reply
#9

I think he knows how to use if
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)