PutPlayerInVehicle - 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)
+--- Thread: PutPlayerInVehicle (
/showthread.php?tid=318724)
PutPlayerInVehicle -
Twisted_Insane - 16.02.2012
Hi all! To make this quick, this CMD doesn't work, I probably missed something?
PHP Code:
CMD:acar(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
PutPlayerInVehicle(playerid, 429, 0);
ChangeVehicleColor(429, 0, 1);
}
else return SendClientMessage(playerid,COLOR_RED,"You have to be level 1 to use that command!");
return 1;
}
Re: PutPlayerInVehicle -
L0zaix - 16.02.2012
it seems its working to me, maybe you did something wrong
Re: PutPlayerInVehicle -
[HK]Ryder[AN] - 16.02.2012
Have have to store the CreateVehicle in a variable.
Or better still create a new vehicle when a person types this command.
Re: PutPlayerInVehicle -
[Diablo] - 16.02.2012
make sure you use vehicleid and not modelid.
Re: PutPlayerInVehicle -
KingHual - 16.02.2012
Quote:
PutPlayerInVehicle(playerid, 429, 0);
|
I think you're mistaking the vehicle ID with vehicle model.
Re: PutPlayerInVehicle -
Twisted_Insane - 16.02.2012
Could be, but I took the ID from here:
https://sampwiki.blast.hk/wiki/Vehicles:All
Where to get the IDs then? I thought on this page are only the IDs!
Re: PutPlayerInVehicle -
[Diablo] - 16.02.2012
those are model id's, vehiceid is returned by createvehicle() or addstaticvehicle()
Re: PutPlayerInVehicle -
[HK]Ryder[AN] - 16.02.2012
If you have many cars of the model 429 then I think you should store a particular one in a variable or create a new vehicle when a person types this cmd.
Re: PutPlayerInVehicle -
niels44 - 16.02.2012
try this one:
pawn Code:
CMD:acar(playerid, params[])
{
new Float:x, Float:y, Float:z,Float:angle;
if(PlayerInfo[playerid][pAdmin] >= 1)
{
PutPlayerInVehicle(playerid, CreateVehicle(429, x,y,z,angle, 0, 0, 60), 0);
ChangeVehicleColor(429, 0, 1);
}
else return SendClientMessage(playerid,COLOR_RED,"You have to be level 1 to use that command!");
return 1;
}
UNTESTED but i think it should work XD
Re: PutPlayerInVehicle -
[HK]Ryder[AN] - 16.02.2012
Quote:
Originally Posted by niels44
try this one:
pawn Code:
CMD:acar(playerid, params[]) { new Float:x, Float:y, Float:z,Float:angle; if(PlayerInfo[playerid][pAdmin] >= 1) { PutPlayerInVehicle(playerid, CreateVehicle(429, x,y,z,angle, 0, 0, 60), 0); ChangeVehicleColor(429, 0, 1);
} else return SendClientMessage(playerid,COLOR_RED,"You have to be level 1 to use that command!"); return 1; }
UNTESTED but i think it should work XD
|
This won't work as the compiler doesnt know what is x,y and z....