problem on ONPLAYERDEATH [+3rep]
#1

what i'm trying to do is :
when a player (in team != 30) die ! i want to give a function to all the players next to the player who is dead ! this is my scripts but it's not working properly
Код:
	new Float:X, Float:Y, Float:Z;


	if(GetPlayerTeam(playerid) != 30)
	{
		GetPlayerPos(playerid,X,Y,Z);
		for (new i = 0; i < MAX_PLAYERS; i++)
		{
  					if(IsPlayerInRangeOfPoint(i, 10, X, Y, Z))
					{
					    	if(GetPlayerTeam(i) != 30) return 1;
						GivePlayerExp(i, 100, "~r~player dead");
					}
		}
		return 1;
	}
Reply
#2

I think there's no people around, because when you die you spawn somewhere, and I'm pretty sure that this function is called while/after spawning.
Reply
#3

no this fuction is called at onplayerdeath !
the thing is that sometime ! it works (maybe if the player attacked the dead player befor he died XD hope u understand what i mean ) sometime it's not working !
Reply
#4

You could try this:
Код:
					    	if( GetPlayerTeam( i ) == 30 )
					    	{
								GivePlayerExp( i, 100, "~r~player dead" );
							}
But I'm not sure that helps (it's just better way to do this, in my opinion), rest of the code looks that it should work, I just don't know how OnPlayerDeath works exactly.
Reply
#5

this is going to apply the function on players who are in team 30 ! i'm searching to apply that on plyaers who are not in team 30
Reply
#6

pawn Код:
if(!GetPlayerTeam[playerid] == 30)
{
//Your code
}
Reply
#7

Quote:
Originally Posted by Amine_Mejrhirrou
Посмотреть сообщение
this is going to apply the function on players who are in team 30 ! i'm searching to apply that on plyaers who are not in team 30
No, this is your code in another way. You see, you do - if(GetPlayerTeam(i) != 30) return 1; which means that if player(s) are not in 30 you return a function, that basically means if( GetPlayerTeams( i ) == 30 ) { //your code }... if you want do in another way you don't have to return a function, do you get it?
Reply
#8

TOEJUS well if it's my code in an othere way the result should be the same ?
Logitech90 if i put "!" in the beging it the same thing that if i put != , the result should be the same too
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)