- 0
Problema cu playerid si player , comanda /me.
-
Similar Content
-
Recently Browsing 0 members
- No registered users viewing this page.
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.
Question
DobreSus
Salut ! Am urmatorul script :
CMD:me(playerid,text[])
{
if(sscanf(text,"s")==0)
{
new action[128] = ">PLAYER_NAME ACTION";
strreplace(action,"PLAYER_NAME",player_name);
strreplace(action,"ACTION",text);
SendClientMessage(playerid,COLOR_PURPLE,action);
for (new player=0;player<MAX_PLAYERS;player++)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(player,x,y,z);
if(playerid!=player)
{
if(GetPlayerDistanceFromPoint(player,x,y,z)<6) SendClientMessage(player,COLOR_PURPLE,action);
}
}
return 1;
}
else return 0;
}
Ce vreau eu sa faca : daca jucatorul X da comanda "/me fumeaza o tigara." sa apara in chat ">X fumeaza o tigara.". Asta intr-un range calculat cu fiecare player prim structura for.
Totusi, am testat pe LAN cu doua calculatoare si sunt 2 mari probleme :
Mesajul apare global, indiferent de distanta dintre cei doi playeri.
Daca am jucatorii X si Y, si Y da comanda "/me", apare ca si cum a dat-o X.
6 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now