Szerző Téma: SinglePlayer féle idõ  (Megtekintve 1194 alkalommal)

SinglePlayer féle idõ
« Dátum: 2014. Június 13. - 08:41:00 »
+2 Show voters
Sziasztok!  :)
Készítettem egy egyszerû kis idõ scriptet.
Annyit csinál hogy amikor elindítod a szervert akkor mindenkinek este lesz.
Az idõ úgy van elkészítve mint a singleplayerben hogy az óra a perc a perc pedig másodperc.
Illetve a SAMP kliensben a szabályoknál a \"worldtime\" sorban is állítódik az idõ.
Nagyon kezdõn írtam ezt szóval ha valami hibát találtok benne jelezzétek! :D
Parancsok:
 
  • /morning - Reggel

  • /night - Este


 
#include <a_samp>
#include <zcmd>
#define zold \"00FF00\"
#define arany \"FFBB00\"
new Hours;
new Minutes;
CMD:morning(playerid, params[])
{
    new string[500];
    format(string, sizeof(string), \"{\"arany\"}%s (%d) {\"zold\"}átállította az idõt reggelre.\",GetName(playerid),playerid);
    SendClientMessageToAll(-1,string);
    Hours = 12;
    Minutes = 0;
return 1;
}
CMD:night(playerid, params[])
{
    new string[500];
    format(string, sizeof(string), \"{\"arany\"}%s (%d) {\"zold\"}átállította az idõt estére.\",GetName(playerid),playerid);
    SendClientMessageToAll(-1,string);
    Hours = 0;
    Minutes = 0;
return 1;
}
public OnFilterScriptInit()
{
    SetTimer(\"WorldTime\", 1000, true);
return 1;
}
public WorldTime()
{
Minutes++;
if(Minutes == 60)
{
    Minutes = 0;
    Hours++;
}
if(Hours == 23)
{
    Hours = 0;
}
new str[50];
format(str, sizeof(str), \"worldtime %02d:%02d\",Hours,Minutes);
SendRconCommand(str);
        for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
                              SetPlayerTime(i, Hours, Minutes);
                }
        }
return 1;
}
stock GetName(playerid)
{
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, sizeof(pName));
return pName;
}
« Utoljára szerkesztve: 2014. Június 15. - 11:38:49 írta Castle »

Nem elérhető gyuri98

  • 153
  • gyuri98
    • Profil megtekintése
SinglePlayer féle idõ
« Válasz #1 Dátum: 2014. Június 13. - 10:05:02 »
0 Show voters
Szép munka jó látni, hogy egy kezdõ nem 3 soros parancsot publikál hanem egy jól mûködõ scriptet :)
Gratulálok csak így tovább
Kapsz is egy + t

SinglePlayer féle idõ
« Válasz #2 Dátum: 2014. Június 13. - 11:08:18 »
0 Show voters
Köszi! :)

SinglePlayer féle idõ
« Válasz #3 Dátum: 2014. December 31. - 21:22:56 »
0 Show voters
Nem rossz.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal