Help me with this bit of script please
#1

#include <a_samp>

public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("SSnS::Cars by skyturnred");
print("--------------------------------------\n");
return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if vehicleid =
{
581,523,462,521,463,522,461,448,468,586,
509,481,510,472,473,493,595,484,430,453,
452,446,454,590,569,537,538,570,449
};
do nothing
else;
AddVehicleComponent(vehicleid, 1010);
return 1;
}


im trying to make it so that when someone enters a car they get nos, but not if its a car that cant have nos, like a plane or nrg
Reply
#2

If they cant have nos they dont add nos so just add veh component and it will add

BTW im not sure if OnPlayerEnterVehicle will work ! Try OnPlayerStateChange

pawn Код:
//Under OnPlayerStateChange
if(GetPlayerState(playerid)) == PLAYER_STATE_DRIVER)
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
}
Reply
#3

Quote:
Originally Posted by coole210
If they cant have nos they dont add nos so just add veh component and it will add

BTW im not sure if OnPlayerEnterVehicle will work ! Try OnPlayerStateChange

pawn Код:
//Under OnPlayerStateChange
if(GetPlayerState(playerid)) == PLAYER_STATE_DRIVER)
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
}
Its not possible to do it on OnPlayerEnterVehicle,
because then it tries to add nos before he actually are inside the car..
Reply
#4

Thanks to both of you, I got it working. It was actually very simple, all i did was replace onplayerentervehicle with onplayerstatechange
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)