Jump to content
  • 0

Problema


Jomes.

Question

Problemă întâlnită (descriere): Nu reusesc sa iau coordonatele playerului de langa mine.
De exemplu daca folosesc o comanda si un player se afla langa mine sa-mi returneze un mesaj..
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul:
[pawn]new Float:Xp, Float:Yp, Float:Zp;
GetPlayerPos(playerid, Xp, Yp, Zp);
if(IsPlayerInRangeOfPoint(playerid, 30.0, Xp, Yp, Zp)) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Move away from any close player before getting the work.");[/pawn]
Imagini / Video (optional):
Aţi încercat să rezolvaţi singur?: Da

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Incearca asa:

[pawn]new Float:Xp, Float:Yp, Float:Zp, Target; GetPlayerPos(target, Xp, Yp, Zp);if(IsPlayerInRangeOfPoint(playerid, 30.0, Xp, Yp, Zp)) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Move away from any close player before getting the work.");[/pawn]

35012l1.png.aee1a3398b9bd9f8eec50574d2cd

Link to comment
Share on other sites

Trebuie sa faci un for care sa stie daca un jucator este aprope de el.

 

[pawn]if(IsPlayerInRangeOfPoint(playerid, 30.0, Xp, Yp, Zp)) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Move away from any close player before getting the work.");[/pawn]

 

asta trebuie s-o inlocuiesti cu asta

 

[pawn]for(new i = 0; i < MAX_PLAYERS; i++)

{

        if(IsPlayerConnected(i))

              if(IsPlayerInRangeOfPoint(i, 30.0, Xp, Yp, Zp))

                     return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Move away from any close player before getting the work.");

}[/pawn]

 

Aici mergi prin toti playeri, vezi daca e online, daca e online verifici daca e aproape de jucatorul respectiv, daca e ii trimiti mesajul si opresti executarea.

Link to comment
Share on other sites

Trebuie sa faci un for care sa stie daca un jucator este aprope de el.

 

[pawn]if(IsPlayerInRangeOfPoint(playerid, 30.0, Xp, Yp, Zp)) return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Move away from any close player before getting the work.");[/pawn]

 

asta trebuie s-o inlocuiesti cu asta

 

[pawn]for(new i = 0; i < MAX_PLAYERS; i++)

{

        if(IsPlayerConnected(i))

              if(IsPlayerInRangeOfPoint(i, 30.0, Xp, Yp, Zp))

                     return SendClientMessage(playerid, COLOR_WHITE, "{FFB870}Move away from any close player before getting the work.");

}[/pawn]

 

Aici mergi prin toti playeri, vezi daca e online, daca e online verifici daca e aproape de jucatorul respectiv, daca e ii trimiti mesajul si opresti executarea.

Parcurge toti playeri online inclusiv si pe mine.

Link to comment
Share on other sites

Mai precis , daca nu intelegi : 

 

if( i == playerid) continue;

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.