30.07.2010, 23:17
SetVehicleParamsForPlayer has it's downs, It has to be re-synced every time a vehicle is streamed in (Which would require a loop, checking if it's a cop vehicle or something, every time a vehicle comes into sight)
And you can't get in it as a passenger, it's best to keep it at OnPlayerStateChange.
And you can't get in it as a passenger, it's best to keep it at OnPlayerStateChange.
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid), m = GetVehicleModel(vehicleid);
if(m == 405)
{
GameTextForPlayer(playerid, "Civilian Vehicle", 3000, 3);
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_WHITE, "You can start your engine by typing: /start");
}
else if(m == 596)
{
new Float:x, Float:y, Float:z;
if(gTeam[playerid] != POLICE)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "You are not a cop!");
}
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_WHITE, "You can start your engine by typing: /start");
}
return 1;
}
return 1;
}