Szerző Téma: Tele Reakció.  (Megtekintve 894 alkalommal)

Tele Reakció.
« Dátum: 2014. Június 17. - 17:33:22 »
0 Show voters
Sziasztok valamiért nem reagál rá mikor elteleportálok, de a timer megy és a szöveget is ki teszi, segítségeitek várom. Köszi.
 
#include <a_samp>
#define RED          0xAA3333AA
#define PURPLE         0xBF60FFFF
#define BLUE          0x1AAD3FF
#define GREEN         0x94D317FF
#define LIGHTBLUE       0x33CCFFAA
#define LIGHTBLUE2      0xF6BB0AA
 
#define Time         60000
#define function%0(%1)   forward%0(%1); public%0(%1)
#define Loop(%0,%1)      for(new %0 = 0; %0 != %1; %0++)
 
new Teleports[][] =
{
    \"/easykp\", \"/funnypk\", \"/upperpk\", \"/extremepk\", \"/hardpk\", \"/bigpk\", \"/oceanicpk\", \"/monsterpk\", \"/lospk\", \"/sivatag\", \"/s000\",
\"/md\", \"/lsair\", \"/ostunt\", \"/lvair\", \"/sfstunt\", \"/cstunt\", \"/sfair\", \"/chilliad\",\"/superstunt\", \"/tube2\", \"/tube3\", \"/si\", \"/golf\", \"/basejump\", \"/bcar\", \"sfj\",
\"/jump1\", \"/jump2\", \"/jump3\", \"/jump4\", \"/wjump\", \"/mpk1\", \"/mpk2\", \"/icerink\",\"/drag1\", \"/drag2\", \"drag3\", \"/canyon\", \"/drift\", \"/drift1\", \"/drift2\", \"/drift3\",
\"/sdrift\", \"/drift4\", \"/island\", \"/party1\", \"/party2\", \"/party3\", \"/party4\", \"/party5\",\"/ls\", \"/lv\", \"/sf\", \"/grov\", \"/beach\", \"/spool\", \"/nrgrainbow\", \"/btbs\",
\"/fplace\", \"/ljump\", \"/rjump\", \"/dunejump\", \"/tjump\", \"/nrgjump\", \"/placejump\", \"/pimps\",\"/jizzy\", \"/jizzyrace\"
},
CmdChars[67] = \"\", CommandReactionTimer, Cash, bool: CommandTestBusy;
public OnFilterScriptInit()
{
print(\"\\nx--------------------------x\");
print(\"| Cmd Reaction TesT LoaDeD |\");
print(\"x--------------------------x\\n\");
CommandReactionTimer = SetTimer(\"CommandReactionTest\", Time, 1);
return 1;
}
public OnFilterScriptExit()
{
print(\"\\nx----------------------------x\");
print(\"| Cmd Reaction TesT UnLoaDeD |\");
print(\"x----------------------------x\\n\");
KillTimer(CommandReactionTimer);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
switch(CommandTestBusy)
{
    case true:
    {
   if(!strcmp(CmdChars, cmdtext, false))
   {
       new string[128], pName[MAX_PLAYER_NAME];
      GetPlayerName(playerid, pName, sizeof(pName));
       format(string, sizeof(string), \"{ffffff} {DCAB00}[Teleport Reakció]{FFFFFF}: %s megnyerte a teleport reakciót. \'{01DBCA}%s{FFFFFF}\', és nyert %d $-t!\", pName, CmdChars, Cash);
        SendClientMessageToAll(0xFFFFFFAA, string);
       GivePlayerMoney(playerid, Cash);
      CommandReactionTimer = SetTimer(\"CommandReactionTest\", Time, 1);
       CommandTestBusy = false;
       return 0;
   }
}
}
return 0;
}
function CommandReactionProgress()
{
    switch(CommandTestBusy)
{
    case true:
    {
        CommandReactionTimer = SetTimer(\"CommandReactionTest\", Time, 1);
        }
}
return 1;
}
function CommandReactionTest()
{
new xLength = (random(8) + 2), string[128];
Cash = (random(10000) + 20000);
format(CmdChars, sizeof(CmdChars), \"\");
Loop(x, xLength) format(CmdChars, sizeof(CmdChars), \"%s\", Teleports[random(sizeof(Teleports))][0]);
format(string, sizeof(string), \"{ffffff} {C0C0C0}[Teleport Reakció]{FFFFFF}: Aki a leghamarabb elteleportál ide: \'{01DBCA}%s {FFFFFF}\' az nyerhet: %d $-t.\", CmdChars, Cash);
SendClientMessageToAll(0xFFFFFFAA, string);
KillTimer(CommandReactionTimer);
CommandTestBusy = true;
SetTimer(\"CommandReactionProgress\", Time, 0);
return 1;
}
« Utoljára szerkesztve: 2014. Június 17. - 19:22:41 írta Flash »

Nem elérhető huhboy

  • 894
  • huhboy
    • Profil megtekintése
Tele Reakció.
« Válasz #1 Dátum: 2014. Június 17. - 17:40:04 »
0 Show voters
ha a \"nem reagál rá\" alatt azt érted, hogy nem teleportál el, akkor azért, mert nincs benne a SetPlayerPos, és ha ugyanaz a parancs kétszer van benne, akkor csak az elsõre fog reagálni....

Tele Reakció.
« Válasz #2 Dátum: 2014. Június 17. - 17:47:13 »
0 Show voters
elteleportál csak nem írja ki a chatba, hogy xy nyerte meg a teleport reakciót. vagy az is lehet gond, hogy nem a modba van?

Nem elérhető Erik3333

  • 945
  • SMF | phpBB | TS3 | PHP | HTML | CSS | JS | PAWN | JAVA
    • Profil megtekintése
Tele Reakció.
« Válasz #3 Dátum: 2014. Június 17. - 19:24:17 »
0 Show voters
A switch-t és a case-t cseréld le if-re.
Például:
 
function CommandReactionProgress()
{
if(CommandTestBusy == true)
{
CommandReactionTimer = SetTimer(\"CommandReactionTest\", Time, 1);
}
return 1;
}

Tele Reakció.
« Válasz #4 Dátum: 2014. Június 19. - 20:49:33 »
0 Show voters
« Utoljára szerkesztve: 2014. Június 19. - 20:51:18 írta [PRO]AcErBiS_V8 »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal