public OnVehicleSpawn(vehicleid) { new newstate; new playerid; new oldstate; if(newstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT) { new vehicle = GetPlayerVehicleID(playerid); new model = GetVehicleModel(vehicle); switch(model) { case 541: SetVehicleHealth(vehicle, 1500); case 596: SetVehicleHealth(vehicle, 2000); case 560: SetVehicleHealth(vehicle, 1500); case 402: SetVehicleHealth(vehicle, 1500); case 427: SetVehicleHealth(vehicle, 7500); case 528: SetVehicleHealth(vehicle, 5000); case 599: SetVehicleHealth(vehicle, 2000); case 601: SetVehicleHealth(vehicle, 4000); case 490: SetVehicleHealth(vehicle, 2500); case 433: SetVehicleHealth(vehicle, 4000); case 470: SetVehicleHealth(vehicle, 2500); case 432: SetVehicleHealth(vehicle, 10000); case 497: SetVehicleHealth(vehicle, 2500); case 487: SetVehicleHealth(vehicle, 1500); } }
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_ONFOOT)
public OnVehicleSpawn(vehicleid)
{
switch(GetVehicleModel(vehicleid))
{
case 402, 487, 541, 560: SetVehicleHealth(vehicleid, 1500);
case 596, 599: SetVehicleHealth(vehicleid, 2000);
case 470, 490, 497: SetVehicleHealth(vehicleid, 2500);
case 433, 601: SetVehicleHealth(vehicleid, 4000);
case 528: SetVehicleHealth(vehicleid, 5000);
case 427: SetVehicleHealth(vehicleid, 7500);
case 432: SetVehicleHealth(vehicleid, 10000);
}
return 1;
}
pawn Код:
&& << Means and Noob SKYPE ME |
The code I posted is fine, you probably have missing or extra bracket(s).
|
public OnVehicleSpawn(vehicleid)
{
switch(GetVehicleModel(vehicleid))
{
case 402, 487, 541, 560: { SetVehicleHealth(vehicleid, 1500); }
case 596, 599: { SetVehicleHealth(vehicleid, 2000); }
case 470, 490, 497: { SetVehicleHealth(vehicleid, 2500); }
case 433, 601: { SetVehicleHealth(vehicleid, 4000); }
case 528: { SetVehicleHealth(vehicleid, 5000); }
case 427: { SetVehicleHealth(vehicleid, 7500); }
case 432: { SetVehicleHealth(vehicleid, 10000); }
}
return 1;
}