15.06.2011, 15:17
(
Last edited by Shadoww5; 15/06/2011 at 04:22 PM.
)
PHP Code:
new V[MAX_PLAYERS];
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_PASSENGER)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 437)
{
SetPlayerPos(playerid, 1.6298, 32.4608, 1199.5938);
SetPlayerFacingAngle(playerid, 181.1296);
V[playerid] = GetPlayerVehicleID(playerid);
return 1;
}
return 1;
}
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_SECONDARY_ATTACK)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, 2.9356, 22.9291, 1199.5938
if(V[playerid] >= 0)
{
new Float:Pos[3];
GetVehiclePos(V[playerid], Pos[0], Pos[1], Pos[2]);
SetPlayerPos(playerid, Pos[0]+4, Pos[1], Pos[2]);
V[playerid] = -1;
}
else { SpawnPlayer(playerid); }
return 1;
}
return 1;
}