Jump to content
  • 0

pomoc Time


gtacko2

Dotaz

Čaute, potrebujem pomoc s casom,

 

napr. Admin dá /time a čas bude na ploche  napr. Event time 0:0 ze od kedy ide event. a ten čas by išlo normalne ako hodiny ale minuty a sekundy 0:0  a admin resetne napr. /resettime a zrusi /zrustime.

 

ďakujem za čoskoru otázku. :) 

Link to comment
Share on other sites

5 odpovědí na tuto otázku

Recommended Posts

  • 0

Pri /time založ timer, naformátuj si čas, predpokľadám že admin ho bude zadávať.

Pri /resettime zabi timer, a založ ho znova.

A pri /zrustime jednoducho ten timer killni.

Link to comment
Share on other sites

  • 0

A nemohol by si to sem dat hotove? aby som nemusel snim srat. :)

 

potrebujem to do event systemu.

Akože sranduješ? :d

 

Ja sa s tým budem srajkať kôli tebe (i keď to je dosť jednoduché)

 

ty si to pridáš na server, a teraz mi povedz.. čo ja z toho budem mať?.. nič

Link to comment
Share on other sites

  • 0

spravil som to ale je tam chiba, niejeto error ani warning,    začina sa to od 35 sekúnd a nie od 0.

 

 

#include <a_samp>

#include <zcmd>
#include <sscanf1>
#include <foreach>
 
#define WRONG_COLOR 0x920000FF
 
//////////////////////////////
/*    new        */
new eventname[354];
 
//////////////////
 
new
Text:Event0[MAX_PLAYERS],
    StartedEventTime,
PlayerTime[MAX_PLAYERS];
 
public OnFilterScriptInit()
{
SetTimer("Time",1000,true);
return 1;
}
 
public OnPlayerConnect(playerid)
{
Event0[playerid] = TextDrawCreate(55.000000, 247.000000, "");
TextDrawBackgroundColor(Event0[playerid], 255);
TextDrawFont(Event0[playerid], 2);
TextDrawLetterSize(Event0[playerid], 0.210000, 1.099999);
TextDrawColor(Event0[playerid], -16711681);
TextDrawSetOutline(Event0[playerid], 1);
TextDrawSetProportional(Event0[playerid], 1);
return 1;
}
 
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
 
command(test, playerid, params[])
{
    if(IsPlayerAdmin(playerid))
  {
    if(sscanf(params, "s", eventname)) return SendClientMessage(playerid, WRONG_COLOR, "Usage: /tent [name]");
    new string[128];
format(string,sizeof(string),"Event Time: 0:0");
    TextDrawSetString(Event0[playerid],string);
    TextDrawShowForPlayer(playerid,Event0[playerid]);
    TogglePlayerControllable(playerid,false);
 
    }
return 1;
}
 
forward Time();
public Time()
{
foreach(Player, i)
{
if(StartedEventTime == 0)
{
PlayerTime++;
new Min=floatround(PlayerTime/60);
new Sec=PlayerTime-(Min*60);
new string[128];
format(string,sizeof(string),"Event time: %02d:%02d",Min,Sec);
TextDrawSetString(Event0,string);
}
}
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...