Help foreach Player
#5

Код:
public OnVehicleSpawn(vehicleid) {
	#if defined DEBUG
	    printf("[debug] OnVehicleSpawn(%d)", vehicleid);
	#endif

	switch(GetVehicleModel(vehicleid)) {
		case 427, 428, 432, 601, 528: SetVehicleHealth(vehicleid, 5000.0); // Enforcer, Securicar, Rhino, SWAT Tank, FBI truck - this is the armour plating dream come true.
	}

	if(vehicleid != 509 && vehicleid != 481 && vehicleid != 510)
	{
	    SetVehicleParamsEx(vehicleid, 0, 0, 0, 0, 0, 0, 0);
		if(IsPackerCar(vehicleid))
		{
	 		if(IsWoodVeh[vehicleid])
			{
				IsWoodVeh[vehicleid] = 0;
				if(IsValidDynamicObject(WoodOnVeh[vehicleid]))
				{
					DestroyDynamicObject(WoodOnVeh[vehicleid]);
				}
			}
		}
		if(IsGasCar(vehicleid))
		{
	 		if(IsGasOnVeh[vehicleid])
			{
				IsGasOnVeh[vehicleid] = 0;
				if(IsValidDynamicObject(GasOnVeh[vehicleid]))
				{
					DestroyDynamicObject(GasOnVeh[vehicleid]);
				}
			}
		}
  		foreach(new i: Player)
		{
 		    if(vehicleid == PlayerInfo[i][pVeh])
		    {
		        if(PlayerInfo[i][vLocked]) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
	            ChangeVehiclePaintjob(PlayerInfo[i][pVeh], PlayerInfo[i][vPJ]);
	            SetVehicleVirtualWorld(PlayerInfo[i][pVeh], PlayerInfo[i][pVehVW]);
				for(new x=0; x<14; i++)
				{
				    AddVehicleComponent(PlayerInfo[i][pVeh], PlayerInfo[i][pVehMod][x]);
				}
		    }
  		    if(vehicleid == PlayerInfo[i][pVVeh])
		    {
		        if(PlayerInfo[i][vvLocked]) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
	            ChangeVehiclePaintjob(PlayerInfo[i][pVVeh], PlayerInfo[i][vvPJ]);
	            SetVehicleVirtualWorld(PlayerInfo[i][pVVeh], PlayerInfo[i][pVVehVW]);
				for(new x=0; x<14; i++)
				{
				    AddVehicleComponent(PlayerInfo[i][pVVeh], PlayerInfo[i][pVVehMod][x]);
				}
		    }
		    if(vehicleid == RentCarKey[i])
		    {
		        if(RentCarLock[i] == 1) SetVehicleParamsEx(vehicleid, 0, 0, 0, 1, 0, 0, 0);
		    }
		}

    }
	return 1;
}
Reply


Messages In This Thread
Help foreach Player - by bigtigerbeee - 03.12.2013, 22:35
Re: Help foreach Player - by eblood1 - 03.12.2013, 22:40
Re: Help foreach Player - by bigtigerbeee - 03.12.2013, 22:44
Re: Help foreach Player - by eblood1 - 03.12.2013, 22:52
Re: Help foreach Player - by bigtigerbeee - 03.12.2013, 23:11
Re: Help foreach Player - by eblood1 - 03.12.2013, 23:28
Re: Help foreach Player - by Jefff - 04.12.2013, 01:12
Re: Help foreach Player - by eblood1 - 04.12.2013, 01:16
Re: Help foreach Player - by Tayab - 04.12.2013, 02:23
Re: Help foreach Player - by Richie© - 04.12.2013, 02:53

Forum Jump:


Users browsing this thread: 1 Guest(s)