Jump to content
  • 0

pomoc [Help] Jméno a ID do chatu


j1KUB

Dotaz

Dobrý den,

Potřeboval bych poradit... Potřebuju když se hráč portne (např. /letiště) tak aby to do chatu napsalo " [Nick] [iD] se odwarpowal na LETIŠTĚ"

Hlavně potřebuju ten NICK.

Někde už jsem viděl toto. "%s se odwarpoval na LETIŠTĚ" ale to když jsem použil tak spadl celej server.

 

Snad mě dobře pochopíte:) Omlouvám se za pravopis, píšu z tabletu:D

 

Díky moc!

Link to comment
Share on other sites

6 odpovědí na tuto otázku

Recommended Posts

  • 0
  • Hlavní moderátor

GetPlayerName

format

new str[128];
GetPlayerName(playerid,str,sizeof(str));
format(str,sizeof(str),"%s(id:%d) se odwarpoval na LETIŠTĚ",str,playerid);
SendClientMessageToAll(-1,str);

nebo si dej do módu tuhle funkci:

PlayerName(playerid)
{
     new name[21];
     GetPlayerName(playerid,name,sizeof(name));
     return name;
}

a pak to používej takto:

new str[128];
format(str,sizeof(str),"%s(id:%d) se odwarpoval na LETIŠTĚ",PlayerName(playerid),playerid);
SendClientMessageToAll(-1,str);
Link to comment
Share on other sites

  • 0

 

http://pawno.cz/topic/42771-format/

http://wiki.sa-mp.com/wiki/Format

 

ukážka:

new meno[MAX_PLAYER_NAME], string[128];
format(string,sizeof(string),"Moje meno je %s(ID %d)",meno,playerid);
SendClientMessage(playerid,-1,string);

ty šmudlo kde máš GetPlayerName

vidim jen new meno[MAX_PLAYER_NAME]

s nulovou hodnotou :d

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...