Detect car's nos
#1

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?
Reply
#2

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;
}
Reply
#3

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;
}
Reply
#4

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)