Szerző Téma: Számláló  (Megtekintve 602 alkalommal)

Nem elérhető Domba

  • 391
    • Profil megtekintése
Számláló
« Dátum: 2010. Szeptember 06. - 14:16:12 »
0 Show voters
Hello!
Nekem egy olyan parancs kellene, hogy /szamlalo
És amikor beírja a játékos elkezd számolni a szerver vissza 3-tól 1-ig és amikor ez meg van akkor írja ki azt háromszor hogy go!
(AMIKOR BEÍRJA A JÁTÉKOS AKKOR VIGYEN LE 500 DOLLÁR A PÉNZÉBÕL!)

Nem elérhető Mambo

  • 4239
    • Profil megtekintése
Számláló
« Válasz #1 Dátum: 2010. Szeptember 06. - 14:20:36 »
0 Show voters
#include <a_samp>
forward CountDown();
new string[128];
new name[MAX_PLAYER_NAME];
new Text:CountTD;
new Count = 5;
new CountText[5][5] = {
\"~r~1\",
\"~g~2\",
\"~g~3\",
\"~w~4\",
\"~w~5\"
};
 
#define COLOR_ORANGE 0xFF830000
#define COLOR_YELLOW 0xFFFF00AA
public OnFilterScriptInit()
{
TextDrawCreate(55.000000,310.000000, \"--\");
TextDrawTextSize(CountTD,63.000000,825.000000);
TextDrawAlignment(CountTD, 2);
TextDrawFont(CountTD,2);
TextDrawLetterSize(CountTD,0.499999,1.800000);
TextDrawSetProportional(CountTD,2);
TextDrawSetShadow(CountTD,1);
TextDrawSetOutline(CountTD, 1);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp(cmdtext, \"/visszaszam\", true)==0)
{
if(Count >= 5)
{
        GetPlayerName(playerid, name, sizeof(name));
       format(string, sizeof(string), \"%s játékos elindította a visszaszámolást! ( Ára: 500$)\", name);
       SendClientMessageToAll(COLOR_YELLOW, string);
GivePlayerMoney(playerid,-500);
CountDown();
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, \"Már megy egy visszaszámlálás!\");
return 1;
}
}
return 0;
}
public CountDown()
{
new str[32];
if (Count > 0 )
{
        format(str,sizeof(str), \"%s\",CountText[Count-1]);
    TextDrawSetString(CountTD, str);
    TextDrawShowForAll(CountTD);
Count--;
SetTimer(\"CountDown\", 1000, 0);
SoundForAll(1056);
}
else if(Count == 0)
{
   TextDrawSetString(CountTD,\"  ~g~GO!GO!GO!\");
    TextDrawShowForAll(CountTD);
SoundForAll(1057);
Count = 5;
SetTimer(\"DestroyText\",3000,0);
}
return 1;
}
public DestroyText();
public DestroyText()
{
TextDrawHideForAll(Text:CountTD);
}
SoundForAll(sound)
{
for (new i = 0, j = GetMaxPlayers(); i < j; i ++)
if (IsPlayerConnected(i))
PlayerPlaySound(i,sound,0.0,0.0,0.0);
}

Nem elérhető Domba

  • 391
    • Profil megtekintése
Számláló
« Válasz #2 Dátum: 2010. Szeptember 06. - 14:50:50 »
0 Show voters
Kössz!
(A témát lezárom.)

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal