ejecting
#1

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
Reply
#2

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.
}
Reply
#3

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
Reply
#4

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
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)