PutPlayerInVehicle
#1

Hi all! To make this quick, this CMD doesn't work, I probably missed something?

PHP Code:
CMD:acar(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 1)
    {
        
PutPlayerInVehicle(playerid4290);
        
ChangeVehicleColor(42901);
    }
    else return 
SendClientMessage(playerid,COLOR_RED,"You have to be level 1 to use that command!");
    return 
1;

Reply
#2

it seems its working to me, maybe you did something wrong
Reply
#3

Have have to store the CreateVehicle in a variable.
Or better still create a new vehicle when a person types this command.
Reply
#4

make sure you use vehicleid and not modelid.
Reply
#5

Quote:

PutPlayerInVehicle(playerid, 429, 0);

I think you're mistaking the vehicle ID with vehicle model.
Reply
#6

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

those are model id's, vehiceid is returned by createvehicle() or addstaticvehicle()
Reply
#8

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.
Reply
#9

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
Reply
#10

Quote:
Originally Posted by niels44
View Post
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....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)