Jump to content
  • 0

pomoc TIPS


FrOsTy14

Dotaz

9 odpovědí na tuto otázku

Recommended Posts

  • 0

Nastavíš si timer s opakováním, který bude spouštět:

static bool:p;
if(p == true) {
 /*zpráva 1*/
 p = false;
}
else {
/*zpráva 2*/
p = true;
}
Link to comment
Share on other sites

  • 0
  • Administrátor

Startem modu si vyvoláš 15 timer.

pak máš možnost 1 random psát zprávu nebo možnost dvě psát je postupně. Minimálně tady bude zhruba  tak 40 návodů

Link to comment
Share on other sites

  • 0

A celý herní mód nechceš poslat ? Co třeba to zkusit aspon zkusit a pokud to nepude tak stím kódem co si "vytvořil" napsat zde a já ti pomůžu klidně.

Link to comment
Share on other sites

  • 0

SetTimerEx("msg",900000, false, "i", playerid);
forward msg(playerid);
public msg(playerid)
{
static bool:p;
if(p == true) {
 SendClientMessage(playerid,COLOR_GREEN,"[TIP] Rádio si můžeš koupit v Elektro Obchodě");
 p = false;
}
else {
 SendClientMessage(playerid,COLOR_GREEN,"[TIP] Rádio si můžeš koupit v Elektro Obchodě");
p = true;
}
}
Link to comment
Share on other sites

  • 0
SetTimerEx("msg",900000, false, "i", playerid);
forward msg(playerid);
public msg(playerid)
{
static bool:p;
if(p == true) {
 SendClientMessage(playerid,COLOR_GREEN,"[TIP] Rádio si můžeš koupit v Elektro Obchodě");
 p = false;
}
else {
 SendClientMessage(playerid,COLOR_GREEN,"[TIP] Rádio si můžeš koupit v Elektro Obchodě");
p = true;
}
}

Výhodnější bude použít SetTimer + cyklus

 

EDIT: Ona vlastně existuje funkce SendClientMessageToAll :d

Edited by Petr
Link to comment
Share on other sites

  • 0

Vytvoříš si forward a následne použiješ to jako public

forward ServerMessages();
public ServerMessages()

Až to budeš mít vytvoříš si v OnGameModeInit timer asi takhle:

SetTimer("ServerMessages", 150000, 1);

číselnou hodnotu si změníš sám

 

No a pak si vytvoříš randon v tom publicu a vytvoříš si zprávy se píšeš.. asi takhle

forward ServerMessages();
public ServerMessages()
{
    switch(random(18))
    {
    case 0:
    {
           SendClientMessageToAll
           return 0;
    }

    case 1:
    {
           SendClientMessageToAll
           return 0;
    }

    case 2:
    {
           SendClientMessageToAll
           return 0;
    }


    return 1;
}

Omlouvám se ale tady bbcode trošku nespolupracuje (rozházené)..

Link to comment
Share on other sites

  • 0

nebo taky možnost:

někam nahoru mezi proměnné

new serverMessages[][] = {
"[TIP] 1",
"[TIP] 2",
"[TIP] 3",
"[TIP] 4",
"[TIP] 5"
};

public serverMessage()
{
    SendClientMessageToAll(COLOR_GREEN, serverMessages[random(sizeof(serverMessages))]);
}
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...