[solved] if statements bringing errors
#4

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 417)
    {
        SendClientMessage(playerid, c_green, "Type /rentcar to rent this or /nty to be ejected :D");
        TogglePlayerControllable(playerid, 0);
        return 1;
    }
    if(GetVehicleModel(vehicleid) == 512)
    {
        SendClientMessage(playerid, c_green, "Type /rentcar to rent this or /nty to be ejected :D");
        TogglePlayerControllable(playerid, 0);
        return 1;
    }
    return 1;
}
That's the correct version. For one thing, you needed to use the function GetVehicleModel which would have returned the actual vehicle model not the vehicle id which is what you were doing. Secondly, you didn't need to get the vehicle id because it's already one of the callback's parameters. Try that out though and it should work.
Reply


Messages In This Thread
[solved] if statements bringing errors - by luigifan9 - 11.05.2010, 00:26
Re: if statements bringing errors - by Backwardsman97 - 11.05.2010, 00:55
Re: if statements bringing errors - by luigifan9 - 11.05.2010, 01:01
Re: if statements bringing errors - by Backwardsman97 - 11.05.2010, 01:07
Re: if statements bringing errors - by luigifan9 - 11.05.2010, 01:28
Re: if statements bringing errors - by Backwardsman97 - 11.05.2010, 01:37

Forum Jump:


Users browsing this thread: 1 Guest(s)