Name Pull
#1

How can the name of the person falling Czech ?

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 killername[MAX_PLAYER_NAME], playername[MAX_PLAYER_NAME],string[256],killerid; //problem
GetPlayerName(killerid, killername, sizeof(killername)); // problem
GetPlayerName(playerid, playername, sizeof(playername)); // problem
format(string, 250, "[Derby]  Player: %s >> %s Water Cuts", killername,playername); // problem
SendClientMessageToAll(-1,string); // problem

ddSira--;
katildim[playerid] = 0;
suPatlamaInmeCikma[playerid] = 0;
DestroyVehicle(ddAraba[playerid]);
SetPVarInt(playerid,"katildi",0);
SpawnPlayer(playerid);
}}
return 1;
}
- My English is bad. Sorry
Reply
#2

Shouldn't this be in OnPlayerDeath?
Also, can you explain your problem a bit better?
Reply
#3

Quote:
Originally Posted by sampkinq
View Post
[CENTER]How can the name of the person falling Czech ?
Sry, i don't understand this question
Reply
#4

give a name to drop the player into the water
Reply
#5

Video Added
Reply
#6

Help me
Reply
#7

Quote:
Originally Posted by sampkinq
View Post
Help me
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
Reply
#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
#9

Quote:
Originally Posted by sampkinq
View Post
same problem
Oh yeah i failed, write the function like this:

Code:
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) || i == playerid) 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
Reply
#10

Quote:
Originally Posted by Kaliber
View Post
Oh yeah i failed, write the function like this:

Code:
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) || i == playerid) 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
Thank You !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)