GTA Közösség - A magyar GTA fórum

San Andreas Multiplayer (SA-MP) => SA-MP: Szerverfejlesztés => Segítségkérés => A témát indította: SilverBoy[SS] - 2010. március 28. - 20:52:46

Cím: Countdown
Írta: SilverBoy[SS] - 2010. március 28. - 20:52:46
Egy countdown script kellene, de olyan hogy más mint amilyen van:
A számlálást, és a \'gogogo\' írást át kellene tenni valahova máshova,
a kistérkép felé. Nem tudom megoldhatóe, de itt vagy egy amin átkellene tenni az írást:
 

#include <a_samp>
forward vissza1();// prototipus
forward vissza2();// prototipus
forward vissza3(); // prototipus
forward vissza4(); // prototipus
new name[MAX_PLAYER_NAME]; // név definicó
new string[128]; //128as karakterlánc
new Float:X;
new Float:Y;
new Float:Z;
#define COLOR_ORANGE 0xFF830000 //szin deficinió
#define COLOR_YELLOW 0xFFFF00AA //SZIN
 
public OnFilterScriptInit() // script
{
print(\"\\n--Count System by GoStop\\n\");
return 1;
}
public OnPlayerConnect(playerid) //amikor csatlakozik
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[]) // megjeleõ szöveg
{
    if(strcmp(cmdtext,\"/count\",true) == 0) //parancs
{
SetTimer(\"vissza4\", 4000, false);
SetTimer(\"vissza1\", 1000, false);
SetTimer(\"vissza2\", 2000, false);
SetTimer(\"vissza3\", 3000, false);
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), \"%s elinditotta a számlálást. (/count)\", name);
SendClientMessageToAll(0x99934EFA, string);
return 1;
}
return 0;
}
public vissza1()
{
GameTextForAll(\"~w~3\",600,6);//megjelenõ szöveg Textben
for(new i; i < MAX_PLAYERS; i++) //mindenkinek mutassa
{
GetPlayerPos(i, X, Y, Z);
PlayerPlaySound(i,1056, X, Y, Z); // elõjövõ zene
}
}
public vissza2()
{
GameTextForAll(\"~w~2\",600,6);//megjelenõ szöveg Textben
for(new i; i < MAX_PLAYERS; i++)//mindenkinek mutassa
{
GetPlayerPos(i, X, Y, Z);
PlayerPlaySound(i,1056, X, Y, Z);// elõjövõ zene
}
}
public vissza3()
{
GameTextForAll(\"~w~1\",600,6);//megjelenõ szöveg Textben
for(new i; i < MAX_PLAYERS; i++)//mindenkinek mutassa
{
GetPlayerPos(i, X, Y, Z);
PlayerPlaySound(i,1056, X, Y, Z);// elõjövõ zene
}
}
public vissza4()
{
GameTextForAll(\"~g~GO~g~GO~g~GO\",600,6); //megjelenõ szöveg Textben
for(new i; i < MAX_PLAYERS; i++)//mindenkinek mutassa
{
GetPlayerPos(i, X, Y, Z);
PlayerPlaySound(i,1056, X, Y, Z);// elõjövõ zene
}
}

 
Egyébként ez a forumról jött nekem
Cím: Countdown
Írta: Csabesz - 2010. március 28. - 21:03:26
Használd ezt.:
 

#include <a_samp>
forward CountDown();
new string[128];
new name[MAX_PLAYER_NAME];
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 OnPlayerCommandText(playerid, cmdtext[])
{
   if (strcmp(cmdtext, \"/count\", 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: 5000$)\", name);
      SendClientMessageToAll(COLOR_YELLOW, string);
GivePlayerMoney(playerid,-5000);
CountDown();
return 1;
}
else
{
SendClientMessage(playerid, COLOR_ORANGE, \"Már megy egy visszaszámlálás!\");
return 1;
}
}
return 0;
}
public CountDown()
{
if (Count > 0)
{
GameTextForAll( CountText[Count-1], 2500, 1); // Itt
Count--;
SetTimer(\"CountDown\", 1000, 0);
SoundForAll(1056);
}
else
{
GameTextForAll(\"~g~-GO! GO! GO!\", 2500, 1); // Itt
SoundForAll(1057);
Count = 5;
}
return 1;
}
SoundForAll(sound)
{
for (new i = 0, j = GetMaxPlayers(); i < j; i ++)
if (IsPlayerConnected(i))
PlayerPlaySound(i,sound,0.0,0.0,0.0);
}

 
·· Ez sokk praktikusabb mint amit GoStop írt.  ;)
Ez nem a radar ( térkép ) felett van, hanem azzal egyvonalban jobb oldalon ( másik oldalt ).  :)
Cím: Countdown
Írta: SilverBoy[SS] - 2010. március 28. - 21:04:54
Az is jó, köszi
Cím: Countdown
Írta: Csabesz - 2010. március 28. - 21:06:23
Nincs mit.   ;)
Cím: Countdown
Írta: SilverBoy[SS] - 2010. március 28. - 21:10:30
Te:O
ezzel valami nem jó XD
folyamatosan az 5öst mutatja, és utánna amikor eltünik: gogogo
Cím: Countdown
Írta: Csabesz - 2010. március 28. - 21:46:37
Értem, akkor megcsinálom TextDraw használatával.  :angel:
Cím: Countdown
Írta: SilverBoy[SS] - 2010. március 29. - 16:03:01
Értem, de én olyasmira gondoltam mint van Epsilonnak (asziszem) egyí espeed nevû scriptje, na olyasmi lenne és abban szálálna  viszza, a radar körül...
De egyébként köszi, mert ez a weboldal jól jött máshoz :P
Cím: Countdown
Írta: Csabesz - 2010. március 29. - 17:47:09
Tessék, megcsináltam.  ;)
Annyi, hogy ez nem GameText, ha nem TextDraw. Remélem nem probléma. :)
 

#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: 5000$)\", name);
      SendClientMessageToAll(COLOR_YELLOW, string);
GivePlayerMoney(playerid,-5000);
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);
}

 
U.I: Ez a radar felett van.
Cím: Countdown
Írta: SilverBoy[SS] - 2010. március 29. - 18:02:27
Fúúú, köszi, ez nagyon király lett, ilyenre gondoltam
köszi:D