"You are not in a delivery vehicle!" - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: "You are not in a delivery vehicle!" (
/showthread.php?tid=540077)
"You are not in a delivery vehicle!" -
Josh_Main - 02.10.2014
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;
}
Re: "You are not in a delivery vehicle!" -
PabloAguado - 02.10.2014
Remove the return thing before the SendClientMessage
Never put the return value before the SendClientMessage function it will always return falsely.
Re: "You are not in a delivery vehicle!" -
Josh_Main - 02.10.2014
What do you mean man?
Re: "You are not in a delivery vehicle!" -
dusk - 02.10.2014
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!");