Jump to content
  • 0

pomoc SetPlayerColor


elRobertino

Dotaz

Ahojte, robím TDM system. Tak, že keď sa niekdo pripojí do týmu, tak mu zmeni farbu nicku. 

 

No potrebujem, keď opustil arenu (cez príkaz) aby sa mu farba zmenila povodnú farbu alebo na nejakú inú farbu. No nie aby sa zmenila vždy napr. na 0xFF9900AA ale náhodnú farbu. Proste ak by odišli 3 hráči aby nemalo rovnaku farbu nicku.

Link to comment
Share on other sites

15 odpovědí na tuto otázku

Recommended Posts

  • 0

do príkazu daj:

 

new r=random(tvoje_cislo);

swtich( r )

{

case 0: SetPlayerColor(playerid,prva_farba);

case 1: SetPlayerColor(playerid,druha_farba);

}

 

poznámka: case bude končiť číslom o 1 menším než si zadal v randome...

 

PS: pawno som už dlhšiu dobu nevidel tak prípadne chyby ohlás v tomto topicu

Link to comment
Share on other sites

  • 0
CMD:opustitdm(playerid, params[])
{
SendClientMessageToAll(0x33CCFFAA, "%s opustil DeathMatch arenu!",PlayerName(playerid));
SpawnPlayer(playerid);
new r=random(18);
switch( r )
{
case 0: SetPlayerColor(0xC0C0C0FF);
case 1: SetPlayerColor(0xFFFFFFFF);
case 2: SetPlayerColor(0x800000FF);
case 3: SetPlayerColor(0xA522AFF);
case 4: SetPlayerColor(0xD2B48CFF);
case 5: SetPlayerColor(0x0000BBAA);
case 6: SetPlayerColor(0x000080FF);
case 7: SetPlayerColor(0x808000FF);
case 8: SetPlayerColor(0x7CFC00FF);
case 9: SetPlayerColor(0x33AA33AA);
case 10: SetPlayerColor(0x00FF00FF);
case 11: SetPlayerColor(0x800080FF);
case 12: SetPlayerColor(0xEE82EEFF);
case 13: SetPlayerColor(0xFFD700FF);
case 14: SetPlayerColor(0xFF7F50FF);
case 15: SetPlayerColor(0xFF9900AA);
case 16: SetPlayerColor(0xFFC0CBFF);
case 17: SetPlayerColor(0xFA8072FF);

}
return 1;
}

Keď zadám prákaz tak mi to zhodí server...

Link to comment
Share on other sites

  • 0
SendClientMessageToAll(0x33CCFFAA, "%s opustil DeathMatch arenu!",PlayerName(playerid));

Tady je chyba nejdřív si udělej new string[150] a pak format(string, sizeof(string), "%s hráč opustil DeathMatch Arenu!",  name);

Link to comment
Share on other sites

  • 0
  • Administrátor

Jen ještě prosím tě změn ten string[150] na string[128] on ti scm stejně nevezme víc znaků než 128 takže je zbytečné mít tam prázdný bajty

Link to comment
Share on other sites

  • 0
  • Hlavní moderátor

Jen ještě prosím tě změn ten string[150] na string[128] on ti scm stejně nevezme víc znaků než 128 takže je zbytečné mít tam prázdný bajty

 

limit pro SCM je 144 znaků

Link to comment
Share on other sites

  • 0

Dávám většinou rovná čísla tak to zaokrouhlím na 150 :d Myslím že těch 6 zase tak nevadí ;)

Ono to tak troch uvadi, protoze kdyz je zprava delsi jak 144 znaku neodesle se vubec, zato kdyz budes mit nastaveno ve formatu, aby se orizla na 144 znaku, tak se odesle a zahodi se konec vety. Vysledek je ten ze se aspon nejaka cast vety odesle

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