Stuck on error making boat missions - 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: Stuck on error making boat missions (
/showthread.php?tid=380024)
Stuck on error making boat missions -
jeremy8810 - 23.09.2012
Hi all,
Im making some boat missions but now im stuck with the vehicle id. I cannot get the vehicle-model of a player.
look:
pawn Код:
forward boat(playerid);
// This callback gets called whenever a player enters a checkpoint
public OnPlayerEnterCheckpoint(playerid)
{
new vehicleid[10];
GetPlayerVehicleID(playerid, vehicleid, sizeof (vehiceid));
if(GetVehicleModel(vehicleid) == 472) // 472 is the Coastguard model
{
TogglePlayerControllable(playerid,0);
SetTimer("boat", 4000, false);
}
// .....etc.....
Now how can I get the vehicle ID, to get the vehicleId to get the vehicle model?
Hope you understand what I mean, otherwise I will explain more...
what I need:
The vehicleID of the player, to get the vehicle model
let me know,
thnx
Re: Stuck on error making boat missions -
Youice - 23.09.2012
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
new vehicleid;
if(IsPlayerInAnyVehicle(playerid))
{
vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 472) // 472 is the Coastguard model
{
//your code
}
}
//---or---
if(IsPlayerInVehicle(playerid, 472/*<<vehicleid*/))
{
//your code
}
return 1;
}