SA-MP Forums Archive
Can Someone Please Tell Me What Is Wrong With This? - 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: Can Someone Please Tell Me What Is Wrong With This? (/showthread.php?tid=141737)



Can Someone Please Tell Me What Is Wrong With This? - jwa3003 - 15.04.2010

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



Re: Can Someone Please Tell Me What Is Wrong With This? - Thrarod - 15.04.2010

Nothing looks wrong - Whats the problem!!!


Re: Can Someone Please Tell Me What Is Wrong With This? - jwa3003 - 15.04.2010

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?



Re: Can Someone Please Tell Me What Is Wrong With This? - jwa3003 - 15.04.2010

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



Re: Can Someone Please Tell Me What Is Wrong With This? - Jay420 - 15.04.2010

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


Re: Can Someone Please Tell Me What Is Wrong With This? - jwa3003 - 15.04.2010

oh of corse thankyou


Re: Can Someone Please Tell Me What Is Wrong With This? - Thrarod - 15.04.2010

GetVehicleModel(GetPlayerVehicleID(playerid)) == 420


Re: Can Someone Please Tell Me What Is Wrong With This? - Jay420 - 15.04.2010

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


Re: Can Someone Please Tell Me What Is Wrong With This? - Thrarod - 15.04.2010

I think he knows how to use if