How come this don't work? - 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: How come this don't work? (
/showthread.php?tid=233123)
How come this don't work? -
ThePlague1988 - 01.03.2011
if(IsPlayerConnected(para1))
{
new Float:testcar[3];
GetPlayerPos(para1, testcar[1], testcar[2], testcar[3]);
new Float:Angle;
GetPlayerFacingAngle(para1, Angle);
new car = CreateVehicle(vehicleid, testcar[1]+2.5, testcar[2]+2.5, testcar[3], Angle, color1, color2, 0);
}
Re: How come this don't work? -
Backwardsman97 - 01.03.2011
What about it doesn't work?
Re: How come this don't work? -
pawn_ - 01.03.2011
pawn Код:
if(IsPlayerConnected(para1))
{
new Float:x, Float:y, Float:z, Float:angle, car;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, angle);
car = CreateVehicle(vehicleid, x+2.5, y+2.5, z, angle, color1, color2, -1);
}
The code is perfect, it's just that you have to
always start at zero on multi-dimensional arrays.
But the above code will work perfectly,
.
And are you sure that 'vehicleid' is the model id?
And I think '0' as the respawn will never spawn the vehicle as it will keep respawning.
Hope I helped.