Code don't work!
#2

Hmm, I've seen A LOT of people make this mistake.

GetPlayerVehicleID doesn't get the model ID, which is what your using, it gets the vehicle ID as per the script. (Example: The first car to be created = 1.)

Use GetVehicleModel as well, before saving it to a variable.

https://sampwiki.blast.hk/wiki/GetVehicleModel

Example:

Код:
public OnPlayerEnterCheckpoint(playerid)
{
    new vehicleid;
    new vehicle;
    vehicleid = GetPlayerVehicleID(playerid);
    vehicle = GetVehicleModel(vehicleid);

    if (vehicle == 403) // linerunner id
    {
        if(IsTrailerAttachedToVehicle(vehicleid))
        {
            GivePlayerMoney(playerid, 800);
            SendClientMessage(playerid, 0xAFAFAFAA,"You have deliver your trailer succesfully, you get 800 dollar for it");
            return 1;
        }
        else
        {
            SendClientMessage(playerid, 0xAFAFAFAA,"You're not in a truck with a trailer!");
            return 1;
        }
    }
    else
    {
        SendClientMessage(playerid, 0xAFAFAFAA,"You're not in a truck!");
        return 1;
    }
}
Reply


Messages In This Thread
Code don't work! - by sean5874 - 10.01.2010, 09:24
Re: Code don't work! - by spartan1178 - 10.01.2010, 10:14
Re: Code don't work! - by sean5874 - 10.01.2010, 11:52
Re: Code don't work! - by Brian_Furios - 10.02.2010, 19:03
Re: Code don't work! - by spartan1178 - 10.02.2010, 21:06

Forum Jump:


Users browsing this thread: 1 Guest(s)