Helmet script
#8

PHP код:
IsPlayerInVehicle(playeridvehicleid) == ... 
Won't go. Replace IsPlayerInVehicle with GetVehicleModel:

PHP код:
//top of script
new Helmet[MAX_PLAYERS];
public 
OnPlayerEnterVehicle(playerid,vehicleid,ispassenger)
{
    if (
GetVehicleModel(vehicleid) == 522 || GetVehicleModel(vehicleid) == 509 
    
|| GetVehicleModel(vehicleid) == 481 
    
|| GetVehicleModel(vehicleid) == 510 
    
|| GetVehicleModel(vehicleid) == 462 
    
|| GetVehicleModel(vehicleid) == 448 
    
|| GetVehicleModel(vehicleid) == 581     
    
|| GetVehicleModel(vehicleid) == 461 
    
|| GetVehicleModel(vehicleid) == 521 
    
|| GetVehicleModel(vehicleid) == 523 
    
|| GetVehicleModel(vehicleid) == 463 
    
|| GetVehicleModel(vehicleid) == 586 
    
|| GetVehicleModel(vehicleid) == 468 
    
|| GetVehicleModel(vehicleid) == 471
    {
    
Helmet[playerid] = CreateObject(18645,0.0,0.0,0.0,0.0,0.0,0.0,30.0);
    
AttachObjectToPlayer(Helmet[playerid], playeridFloat:OffsetXFloat:OffsetYFloat:OffsetZFloat:rXFloat:rYFloat:rZ);
    }
    return 
1;
}
public 
OnPlayerExitVehicle(playerid,vehicleid)
{
    
DestroyObject(Helmet[playerid]);
    return 
1;

I only suggest you to use this under OnPlayerStateChange coz OnPlayerExitVehicle isn't called if you use SetPlayerPos or if he falls off a bike
Reply


Messages In This Thread
Helmet script - by wumpyc - 04.10.2011, 11:55
Re: Helmet script - by TheMaddox - 04.10.2011, 11:57
Re: Helmet script - by [GOD]Dragonster82 - 04.10.2011, 12:03
Re: Helmet script - by hittt - 04.10.2011, 12:04
Re: Helmet script - by wumpyc - 04.10.2011, 12:09
Re: Helmet script - by hittt - 04.10.2011, 12:11
Re: Helmet script - by wumpyc - 04.10.2011, 12:11
Re: Helmet script - by [MG]Dimi - 04.10.2011, 12:14
Re: Helmet script - by [GOD]Dragonster82 - 04.10.2011, 12:16
Re: Helmet script - by [MG]Dimi - 04.10.2011, 12:17

Forum Jump:


Users browsing this thread: 1 Guest(s)