Name Pull
#8

Quote:
Originally Posted by Kaliber
View Post
So try it like this:

Code:
public OnPlayerUpdate(playerid)
{
	if(suPatlamaInmeCikma[playerid] == 1)
	{
		new Float:X, Float:Y, Float:Z;
		GetPlayerPos(playerid, X, Y, Z);
		if(IsPlayerInRangeOfPoint(playerid, 0.5, X, Y, 0.0))
		{
			new pName[MAX_PLAYER_NAME],string[128];
			GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
			new pID = GetClosestPlayer(playerid);
			if(pID == INVALID_PLAYER_ID) {
			    format(string,128,"[Derby] Player: %s has fallen in the water.",pName);
			    SendClientMessageToAll(-1,string);
			} else {
			    new kName[MAX_PLAYER_NAME];
				GetPlayerName(pID, kName, MAX_PLAYER_NAME);
				format(string, 128, "[Derby]  Player: %s >> %s Water Cuts", pName,kName);
				SendClientMessageToAll(-1,string);
			}
			ddSira--;
			katildim[playerid] = 0;
			suPatlamaInmeCikma[playerid] = 0;
			DestroyVehicle(ddAraba[playerid]);
			SetPVarInt(playerid,"katildi",0);
			SpawnPlayer(playerid);
		}
	}
	return 1;
}
stock GetClosestPlayer(playerid) {
	new Float:p[3],i,Float:x,Float:t=70.0,tmp;
	GetPlayerPos(playerid,p[0],p[1],p[2]);
	for(; i<MAX_PLAYERS; i++) {
	    if(!IsPlayerConnected(i)) continue;
	    x = GetPlayerDistanceFromPoint(i,p[0],p[1],p[2]);
	    if(x < t) t = x,tmp=i;
	}
	return (t==70.0)?INVALID_PLAYER_ID:tmp;
}
Greekz
same problem
Reply


Messages In This Thread
Name Pull [Video Added] - by sampkinq - 11.03.2015, 17:11
Re: Name Pull - by CalvinC - 11.03.2015, 17:14
AW: Name Pull - by Kaliber - 11.03.2015, 17:14
Re: AW: Name Pull - by sampkinq - 11.03.2015, 17:29
Re: Name Pull - by sampkinq - 11.03.2015, 17:59
Re: Name Pull - by sampkinq - 11.03.2015, 20:16
AW: Re: Name Pull - by Kaliber - 11.03.2015, 21:02
Re: AW: Re: Name Pull - by sampkinq - 11.03.2015, 21:43
AW: Re: AW: Re: Name Pull - by Kaliber - 11.03.2015, 23:33
Re: AW: Re: AW: Re: Name Pull - by sampkinq - 12.03.2015, 15:54

Forum Jump:


Users browsing this thread: 1 Guest(s)