"You are not in a delivery vehicle!"
#1

When I enter the checkpoint, why does it say "You are not in a delivery vehicle" even when I am?

pawn Код:
if(!IsPlayerInVehicle(playerid, 515)) return SendClientMessage(playerid, GREY, "You are not in a delivery vehicle!");
    else if(IsPlayerInCheckpoint(playerid))
    {
        if(Removalist[playerid] == 1)
        DisablePlayerCheckpoint(playerid);
        SendClientMessage(playerid, ORANGE, "You have delivered the goods and received $500!");
        GivePlayerMoney(playerid, 500);
        Removalist[playerid] = 0;
    }
    return 1;
}
Reply
#2

Remove the return thing before the SendClientMessage
Never put the return value before the SendClientMessage function it will always return falsely.
Reply
#3

What do you mean man?
Reply
#4

Because you check if a player is in a vehicle which ID is 515. You probably wanted to check the [italic]model[/italic] of a vehicle, you can do it like so:
pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 515) return SendClientMessage(playerid, GREY, "You are not in a delivery vehicle!");
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)