Jump to content

ID hráče v chatu


W4rm3x

Recommended Posts

Zdravím Vás lidičky, v tomhle TuTu si ukážeme něco, co zde už možná je.

Jak ste mohli přečíst nápis tak je to ID hráče v chatu.

Zde máte celej kód

public OnPlayerText(playerid, text[])
{
   new string[128];
format(string,128, "(%d) %s", playerid,text);
SendPlayerMessageToAll(playerid, string);
return 0;
}

 

Pokud by jste to chtěli barevně:

public OnPlayerText(playerid, text[])
{new string[128];
format(string,128, "{Kód barvy}ID:#%d {Kod barvy}Napsal:{Kód barvy}:%s", playerid,text);
SendPlayerMessageToAll(playerid, string);
return 0;
}

 

Pro vysvětlení:

 

public OnPlayerText(playerid, text[])

{

new string[128]; // je maximální proměnná stringu

format(string,128, "(%d) %s", playerid,text); //Formát uspořádání textu

SendPlayerMessageToAll(playerid, string); //V chatu to uvidí všichni

return 0; //aby to napsalo pouze 1x

}

Link to comment
Share on other sites

  • 1 month later...

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...