Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: mrockxkingbutt on February 08, 2014, 07:37:42 pm

Title: Timing System!!!!! [ Working By Me ]
Post by: mrockxkingbutt on February 08, 2014, 07:37:42 pm
 :D

Changelog!!

For A Better Touch!!

Add
Quote
Hours[MAX_PLAYERS];
Days[MAX_PLAYERS];
Minutes[MAX_PLAYERS];
Seconds[MAX_PLAYERS];

Add This In OnPlayerText
Quote
   else if(strcmp(cmd, "!time", true) == 0) {
   new none[127];
   format(none,sizeof(none)," Time [ %d : %d : %d : %d  ]", SecondsFile(playerid), MinutesFile(playerid), HoursFile(playerid),DaysFile(playerid));
GameTextForPlayerBottom(i,none);
return 1;
}   

OnGameModeInIt

Quote
SetTimer("IncSeconds", 1000, 1);
SetTimer("IncMinutes", 59000, 1);

Now For Publics

Quote
public SecondsFile(playerid) {
return Seconds[playerid];
}

public DaysFile(playerid) {
return Days[playerid];
}

public MinutesFile(playerid) {
return Minutes[playerid];
}

public HoursFile(playerid) {
return Hours[playerid];
}

public IncSeconds() {
    for(new i = 0; i < MAX_PLAYERS; i++) {
Seconds++;
}
    for(new i = 0; i < MAX_PLAYERS; i++) {
if(Seconds == 59) {
Seconds = 0;
}
}
return 1;
}

public IncMinutes()
{
    for(new i = 0; i < MAX_PLAYERS; i++) {
Minutes++;
new ss[123];
format(ss,sizeof(ss),"[Time] %d : %d : %d", SecondsFile(i), MinutesFile(i), HoursFile(i));
GameTextForPlayerBottom(i,ss);
}
    for(new i = 0; i < MAX_PLAYERS; i++) {
if(Minutes == 61) {
Minutes = 0;
IncHours++;
}
}
return 1;
}

public IncHours()
{
    for(new i = 0; i < MAX_PLAYERS; i++) {
Hours++;
new ss[123];
format(ss,sizeof(ss),"[Time] %d : %d : %d : %d", SecondsFile(i), MinutesFile(i), HoursFile(i),DaysFile(i));
GameTextForPlayerBottom(i,ss);
}
    for(new i = 0; i < MAX_PLAYERS; i++) {
if(Hours == 25) {
Hours = 0;
Day[playerid]++;
}
}
return 1;
}

Saw A Bug Report It!!!

Credits Me

Features

Replacable By SetWorldTime

Just Can Change Weather..

+ Rcon Features To Change !!

/sethr
/setweather

Its SHow And Increases Time

Seconds Every Seconds
Minutes EVery 60 Seconds
Hours Every 60 Minutes
Days Every 24 Hour!





   

Title: Re: Timing System!!!!! [ Working By Me ]
Post by: sseebbyy on February 09, 2014, 12:09:34 am
Why are you using so big size for texts you write dude ? I just don't get it. (advanced logic?)
(http://1.bp.blogspot.com/-Dj0ozuQdty4/Tx8C4x9uxYI/AAAAAAAAJ-M/7qP7lCTUqg8/s400/jackie%2Bchan.jpg)



About script... you could use just one timer, instead of three.
By the way, announcing players about increasing their playing time status at every minute is not a good idea.
And what happens when a player will play for 25 hours ? His Hours' stats will get reset.
Title: Re: Timing System!!!!! [ Working By Me ]
Post by: mrockxkingbutt on February 09, 2014, 01:09:42 am
Most Pawns Server Are Port Forwarded Working Only!!!

So No-One Can Port Forward ANd Run Server For 24 Hours

If Anyone Can
!!

I Will Edit It And Add Days Ok???
Title: Re: Timing System!!!!! [ Working By Me ]
Post by: mrockxkingbutt on February 11, 2014, 02:02:40 am
Changed !!!  :)
Title: Re: Timing System!!!!! [ Working By Me ]
Post by: MatheuS on February 11, 2014, 04:19:54 am
why you do not use [ pawn ] teste [ /pawn ]  :o
Title: Re: Timing System!!!!! [ Working By Me ]
Post by: mrockxkingbutt on February 11, 2014, 03:21:47 pm
pawno code s**ks
Title: Re: Timing System!!!!! [ Working By Me ]
Post by: Fuzzy168 on February 11, 2014, 03:42:16 pm
pawno code s**ks
Quote of The Year 2014.  ::)
Title: Re: Timing System!!!!! [ Working By Me ]
Post by: MatheuS on February 11, 2014, 05:40:48 pm
pawno code s**ks
Quote of The Year 2014.  ::)

 :o  ::)
Title: Re: Timing System!!!!! [ Working By Me ]
Post by: sseebbyy on February 11, 2014, 10:24:05 pm
Use [ code ] instead of [ quote ] or [ pawn ].
Title: Re: Timing System!!!!! [ Working By Me ]
Post by: mrockxkingbutt on February 12, 2014, 08:11:54 pm
Next Time Ok??  :)
Title: Re: Timing System!!!!! [ Working By Me ]
Post by: MatheuS on February 12, 2014, 11:43:48 pm
Next Time Ok??  :)

Okay  ;)