Detect car's nos - 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: Detect car's nos (
/showthread.php?tid=510520)
Detect car's nos -
iBots - 01.05.2014
Hey,i have created a system for nos ,if you enter a car which has a nitro it sends a message to you,how could i detect if the car has a nos,the one he enters?
Re: Detect car's nos -
awsomedude - 01.05.2014
Here
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
{
if(GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),GetVehicleComponentType(1010)) == 1010)
{
SendClientMessage(playerid, -1, "Has Nitro");
}
}
return 1;
}
Re: Detect car's nos -
Teemo - 01.05.2014
OR Try this:
pawn Код:
public OnPlayerEnterVehicle(playerid, newstate, oldstate)
{
if(GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),GetVehicleComponentType(1010)) == 1010)
{
ShowPlayerDialog(playerid, 122, DIALOG_STYLE_MSGBOX, "Vehicle Status:", "Nitro: Installed\n", "Close, "");
}
}
return 1;
}
Re: Detect car's nos -
Kyance - 01.05.2014
Quote:
Originally Posted by Teemo
OR Try this:
pawn Код:
public OnPlayerEnterVehicle(playerid, newstate, oldstate) { if(GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),GetVehicleComponentType(1010)) == 1010) { ShowPlayerDialog(playerid, 122, DIALOG_STYLE_MSGBOX, "Vehicle Status:", "Nitro: Installed\n", "Close, ""); } } return 1; }
|
Dude..
OnPlayerEnterVehicle has different stuff,
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
And using dialogs for such things isn't really needed.