Checking what car a player's in - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checking what car a player's in (
/showthread.php?tid=135534)
Checking what car a player's in -
jameskmonger - 20.03.2010
This code:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new carmodel;
carmodel = GetPlayerVehicleID(playerid);
if(carmodel = 498) {
SendClientMessage(playerid, COLOR_GREY, "You are in a Boxville, use /delivery to start the mission.");
}
return 1;
}
Sends that clientmessage every time I enter ANY car.
Re: Checking what car a player's in -
dice7 - 20.03.2010
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new carmodel, vehid;
vehid = GetPlayerVehicleID(playerid); //getting the vehicle id (unique id a server uses to identify each car). no vehicle id is the same as any other on one server
carmodel = GetVehicleModel(vehid); //getting the model. this can be the same, eg 2 infernuses
if(carmodel == 498) {
SendClientMessage(playerid, COLOR_GREY, "You are in a Boxville, use /delivery to start the mission.");
}
//or just
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 498) {
SendClientMessage(playerid, COLOR_GREY, "You are in a Boxville, use /delivery to start the mission.");
}
return 1;
}
Re: Checking what car a player's in -
jameskmonger - 20.03.2010
I've got this:
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 498) {
SendClientMessage(playerid, COLOR_GREY, "You are in a Boxville, use /delivery to start the mission.");
}
//===========================================START OF POLICE===============================================
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 599 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 598) {
if(!PlayerInfo[playerid][pFaction] == 1) {
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_WHITE, "This is a faction only car!");
}
}
return 1;
}
Yet I can enter the vehicle on a new account.
Re: Checking what car a player's in -
dice7 - 20.03.2010
which vehicle ?
Re: Checking what car a player's in -
jameskmonger - 20.03.2010
599 (ranger) or 598 (Las Venturas cop car).