SA-MP Forums Archive
ejecting - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: ejecting (/showthread.php?tid=130111)



ejecting - aircombat - 25.02.2010

i made an ejection system so if player is in a hydra or rustler and press Space , it eject the player but it doesnt work :
V
V
V
V
V
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
  new vehicleid = GetPlayerVehicleID(playerid);
  new modelid = GetVehicleModel(vehicleid);
	if((newkeys & KEY_HANDBRAKE))
	{
	  if(modelid == 476 && modelid == 520)
	  {
   	
	    GivePlayerWeapon(playerid,46,1);
	    new Float:pos[3]; GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
	    SetPlayerPos(playerid,pos[0],pos[1],pos[2]+30);
	    GameTextForPlayer(playerid, "Ejecting..", 5000, 5);
	  }
	}
	return 1;
}
2. How to make if a player dies from TEAM_LS all the players from TEAM_LV gets 100$ and opposite??
________
EXERCISE / FITNESS FORUMS


Re: ejecting - Correlli - 25.02.2010

Of course it doesn't work, here's your mistake:
pawn Код:
if(modelid == 476 && modelid == 520)
{
  // other code.
}
Player can't be in the both vehicles at the same time.

Correct:
pawn Код:
if(modelid == 476 || modelid == 520)
{
  // other code.
}



Re: ejecting - mick88 - 25.02.2010

Nice piece of code. When you eject player you could try to set his Z velocity so that the player actually shoots upwards instead of just teleporting him higher. Just an idea you could use


Re: ejecting - silvan - 25.02.2010

Or you could use the command " RemovePlayerFromVehicle(playerid); "

with this code:

Код:
SetPlayerControllable(playerid,0);
RemovePlayerFromVehicle(playerid);
SetPlayerControllable(playerid,1);
PS: I use it in my gm which it works perfectly for lock


Re: ejecting - aircombat - 25.02.2010

Quote:
Originally Posted by Don Correlli
Of course it doesn't work, here's your mistake:
pawn Код:
if(modelid == 476 && modelid == 520)
{
  // other code.
}
Player can't be in the both vehicles at the same time.

Correct:
pawn Код:
if(modelid == 476 || modelid == 520)
{
  // other code.
}
thnx dude xD
________
Pornstars Indian