[POMOC] Reakcije.

Započeo Mile_Anderson
13. Jul 2015. Zaključano
321
pregleda
8
postova
Darko Neskovic
4
Shot Caller
13. Jul 2015.
Skripta koju koristim: UP
Opis problema o kojem se radi: ubacio sam reakcije u mod da ne bi koristio fs i sada pojavi se reakcija ja je ukucam ali nista se ne dogadja.....
Dio skripte:
switch(xTestBusy)
    {
        case true:
        {
  if(!strcmp(xChars, text, false)) {
  new string, pName;
  GetPlayerName(playerid, pName, sizeof(pName));
  format(string, sizeof(string), ""SC"Reaciont-BOT: "GREY"Igrac "WHITE"%s "GREY"je bio najbrzi i osvojio odredjenu sumu novca", pName);
  SendClientMessageToAll(-1, string);
  format(string, sizeof(string), ""SC"Reakcije: "DGREEN"Cestitam! "GREY"Bio si najbrzi i osvojio "DGREEN"%d$.", xCash);
  SendClientMessage(playerid, -1, string);
  g_NovacPlus(playerid, xCash);
  SetPlayerScore(playerid, GetPlayerScore(playerid));
  xReactionTimer = SetTimer("xReactionTest", TIME, 1);
  xTestBusy = false; } } }

  return 1;
}
//////////////////////////////////////////////////////////////////////////////
forward xReactionProgress();
public xReactionProgress()
{
  switch(xTestBusy) {
  case true: {
  new string ;
  format(string, sizeof(string), ""SC"Reakcije: "GREY"Niko nije napisao rec kako treba!", (TIME/60000));
  SendClientMessageToAll(-1, string);
  xReactionTimer = SetTimer("xReactionTest", TIME, 1); } }

  return 1;
}
//----------------------------------------------------------------------------//
forward xReactionTest();
public xReactionTest()
{
  new xLength = (random(8) + 2), string ;
  xCash = (random(2000));
  format(xChars, sizeof(xChars), "");
  Loop(x, xLength) format(xChars, sizeof(xChars), "%s%s", xChars, xCharacters[random(sizeof(xCharacters))]);
  format(string, sizeof(string), ""SC"Reakcije: "GREY"Igra je pocela! Ko prvi upise "WHITE"%s "GREY"osvaja "DGREEN"%d$.", xChars, xCash);
  SendClientMessageToAll(-1, string);
  KillTimer(xReactionTimer);
  xTestBusy = true;
  SetTimer("xReactionProgress", 30000, 0);

  return 1;
}

Slika (neobavezno): http://i.imgur.com/GebviEv.png
Vuzimir
5
Kingpin
13. Jul 2015.
ja sam bas sada skinuo to sa neta i ubacio kod sebe u mod i sve perfekno radi, najvjerovatnije da ti je nesto omaklo kada si prebacivao...
Darko Neskovic
4
Shot Caller
13. Jul 2015.
Vuzimir wrote on July 13, 2015, 9:44 am:
ja sam bas sada skinuo to sa neta i ubacio kod sebe u mod i sve perfekno radi, najvjerovatnije da ti je nesto omaklo kada si prebacivao...
Pa ova reakcija je bila u fs i sad prebacio sam je u mod tacno kako je tamo bilo nisam nista izostavio ne znam zbog cega
EDIT: da nisam ovde mozda pogresio ?
new xCharacters[][] =
{
  "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
  "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
  "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
  "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
  "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
},
  xChars = "",
  xReactionTimer,
  xCash,
bool: xTestBusy;
#define Loop(%0,%1) for(new %0 = 0; %0 != %1; %0++)
Vuzimir
5
Kingpin
13. Jul 2015.
ae ovako dodaj:
na vrh:
#if !defined Loop
#define Loop(%0,%1) \
        for(new %0 = 0; %0 != %1; %0++)
#endif

#if !defined function
#define function%0(%1) \
        forward%0(%1); public%0(%1)
#endif

#if !defined PURPLE
#define PURPLE \
    0xBF60FFFF
#endif

#if !defined GREEN
#define GREEN \
    0x94D317FF
#endif

#if !defined TIME
#define TIME \
    180000
#endif
new
        xCharacters[][] =
        {
            "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
                "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
            "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
                "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
            "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
        },
        xChars = "",
        xReactionTimer,
        xCash,
        xScore,
        bool: xTestBusy
;


pod OnGameModeInit:
xReactionTimer = SetTimer("xReactionTest", TIME, 1);

Pod OnGameModeExit:
KillTimer(xReactionTimer);

Pod OnPlayerText znaci na vrh tog publica:
 switch(xTestBusy)
        {
            case true:
            {
                        if(!strcmp(xChars, text, false))
                        {
                            new
                                string,
                                pName
                                ;
                                GetPlayerName(playerid, pName, sizeof(pName));
                                format(string, sizeof(string), "« \%s\" has won the reaction test. »", pName);
                            SendClientMessageToAll(GREEN, string);
                            format(string, sizeof(string), "« You have earned $%d + %d score points. »", xCash, xScore);
                            SendClientMessage(playerid, GREEN, string);
                            GivePlayerMoney(playerid, xCash);
                                SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore);
                                xReactionTimer = SetTimer("xReactionTest", TIME, 1);
                            xTestBusy = false;
                        }
                }
        }


na dno skripte:
function xReactionProgress()
{
  switch(xTestBusy)
        {
            case true:
            {
                    new
                        string
                        ;
                        format(string, sizeof(string), "« No-one won the reaction-test. New one starting in %d minutes. »", (TIME/60000));
                    SendClientMessageToAll(PURPLE, string);
                xReactionTimer = SetTimer("xReactionTest", TIME, 1);
      }
        }
        return 1;
}

function xReactionTest()
{
        new
                xLength = (random(8) + 2),
                string
        ;
        xCash = (random(10000) + 20000);
        xScore = (random(2)+1);
        format(xChars, sizeof(xChars), "");
        Loop(x, xLength) format(xChars, sizeof(xChars), "%s%s", xChars, xCharacters[random(sizeof(xCharacters))]);
        format(string, sizeof(string), "« Who first types %s wins $%d + %d score points. »", xChars, xCash, xScore);
        SendClientMessageToAll(PURPLE, string);
        KillTimer(xReactionTimer);
        xTestBusy = true;
        SetTimer("xReactionProgress", 30000, 0);
        return 1;
}
Darko Neskovic
4
Shot Caller
13. Jul 2015.
Vuzimir wrote on July 13, 2015, 11:00 am:
ae ovako dodaj:
na vrh:
#if !defined Loop
#define Loop(%0,%1) \
        for(new %0 = 0; %0 != %1; %0++)
#endif

#if !defined function
#define function%0(%1) \
        forward%0(%1); public%0(%1)
#endif

#if !defined PURPLE
#define PURPLE \
    0xBF60FFFF
#endif

#if !defined GREEN
#define GREEN \
    0x94D317FF
#endif

#if !defined TIME
#define TIME \
    180000
#endif
new
        xCharacters[][] =
        {
            "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
                "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
            "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
                "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
            "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
        },
        xChars = "",
        xReactionTimer,
        xCash,
        xScore,
        bool: xTestBusy
;


pod OnGameModeInit:
xReactionTimer = SetTimer("xReactionTest", TIME, 1);

Pod OnGameModeExit:
KillTimer(xReactionTimer);

Pod OnPlayerText znaci na vrh tog publica:
 switch(xTestBusy)
        {
            case true:
            {
                        if(!strcmp(xChars, text, false))
                        {
                            new
                                string,
                                pName
                                ;
                                GetPlayerName(playerid, pName, sizeof(pName));
                                format(string, sizeof(string), "« \%s\" has won the reaction test. »", pName);
                            SendClientMessageToAll(GREEN, string);
                            format(string, sizeof(string), "« You have earned $%d + %d score points. »", xCash, xScore);
                            SendClientMessage(playerid, GREEN, string);
                            GivePlayerMoney(playerid, xCash);
                                SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore);
                                xReactionTimer = SetTimer("xReactionTest", TIME, 1);
                            xTestBusy = false;
                        }
                }
        }


na dno skripte:
function xReactionProgress()
{
  switch(xTestBusy)
        {
            case true:
            {
                    new
                        string
                        ;
                        format(string, sizeof(string), "« No-one won the reaction-test. New one starting in %d minutes. »", (TIME/60000));
                    SendClientMessageToAll(PURPLE, string);
                xReactionTimer = SetTimer("xReactionTest", TIME, 1);
      }
        }
        return 1;
}

function xReactionTest()
{
        new
                xLength = (random(8) + 2),
                string
        ;
        xCash = (random(10000) + 20000);
        xScore = (random(2)+1);
        format(xChars, sizeof(xChars), "");
        Loop(x, xLength) format(xChars, sizeof(xChars), "%s%s", xChars, xCharacters[random(sizeof(xCharacters))]);
        format(string, sizeof(string), "« Who first types %s wins $%d + %d score points. »", xChars, xCash, xScore);
        SendClientMessageToAll(PURPLE, string);
        KillTimer(xReactionTimer);
        xTestBusy = true;
        SetTimer("xReactionProgress", 30000, 0);
        return 1;
}
ovo function tako dodajem ili stavljam public ?
Vuzimir
5
Kingpin
13. Jul 2015.
samo tako dodas... posto gore ti je defajnovano to function
Darko Neskovic
4
Shot Caller
13. Jul 2015.
Vuzimir wrote on July 13, 2015, 11:30 am:
samo tako dodas... posto gore ti je defajnovano to function
Ja tako kad dodam ne mogu da compile mod kad pisem public ja mogu i izadje mi ono 2 warning,da stavim forward znas vec
EDIT:Radi sve dodao sam ovo forward sve radi i reakcije hvala Vuzi moze lock 🙂
forward xReactionProgress();
public xReactionProgress()
forward xReactionTest();
public xReactionTest()
Vuzimir
5
Kingpin
13. Jul 2015.
Nema na cemu 😄


Lock na zahtjev autora teme.

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha