Help with /tune command!
#1

Right... So I'm trying to create a /tune command that based on what vehicle your at it'll teleport you to the right tunning place.
Here's the code:

Код:
CMD:tune(playerid, params)
{
    new vehicleid = GetVehicleModel(vehicleid);
    if(vehicleid == 411)
    {
        new vh = GetPlayerVehicleID(playerid);
        SetVehiclePos(vh, -1935.4719, 229.8815, 34.2646);
        PutPlayerInVehicle(playerid, vh, 0);
        GameTextForPlayer(playerid," ~y~Transfender", 4000, 6);
    }
    else if(vehicleid == 562)
    {
        new vh = GetPlayerVehicleID(playerid);
        SetVehiclePos(vh, -2706.2625, 216.9816, 4.1894);
        PutPlayerInVehicle(playerid,vh, 0);
        GameTextForPlayer(playerid,"~y~Wheels Arch Angels", 4000, 6);
    }
    return 1;
}
It has no erros/warnings during compile, but when I type "/tune" in-game nothing happens...
Reply
#2

You created the variable 'vehicleid' to get the vehicle model of the same variable you just created, which would be 0 since you didn't assign it a value.

Код:
 
new vehicleid = GetVehicleModel(GetPlayerVehicleID(playerid));
Reply
#3

Oh, thanks for the hand lol.... It's been a while since I played with Pawn so I forgot most of the stuff
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)