01.05.2014, 13:47
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?
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;
}
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;
}
OR Try this:
pawn Код:
|
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}