Need Change That
#1

Need Help!

Want Only Date (07/07/2009)
Not Clock (16:24:15)

Plz Change That!

Code:
/*
                                  dddddddd
  SSSSSSSSSSSSSSS hhhhhhh                     d::::::d
 SS:::::::::::::::Sh:::::h                     d::::::d
S:::::SSSSSS::::::Sh:::::h                     d::::::d
S:::::S   SSSSSSSh:::::h                     d:::::d
S:::::S       h::::h hhhhh     aaaaaaaaaaaaa   ddddddddd:::::d
S:::::S       h::::hh:::::hhh   a::::::::::::a  dd::::::::::::::d
 S::::SSSS     h::::::::::::::hh  aaaaaaaaa:::::a d::::::::::::::::d
 SS::::::SSSSS   h:::::::hhh::::::h      a::::ad:::::::ddddd:::::d
  SSS::::::::SS  h::::::h  h::::::h  aaaaaaa:::::ad::::::d  d:::::d
    SSSSSS::::S h:::::h   h:::::h aa::::::::::::ad:::::d   d:::::d
      S:::::S h:::::h   h:::::h a::::aaaa::::::ad:::::d   d:::::d
      S:::::S h:::::h   h:::::ha::::a  a:::::ad:::::d   d:::::d
SSSSSSS   S:::::S h:::::h   h:::::ha::::a  a:::::ad::::::ddddd::::::dd
S::::::SSSSSS:::::S h:::::h   h:::::ha:::::aaaa::::::a d:::::::::::::::::d
S:::::::::::::::SS h:::::h   h:::::h a::::::::::aa:::a d:::::::::ddd::::d
 SSSSSSSSSSSSSSS  hhhhhhh   hhhhhhh aaaaaaaaaa aaaa ddddddddd  ddddd
*/


#include <a_samp>
#define FILTERSCRIPT

new Text:Time, Text:Date;

forward settime(playerid);

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" Updated Version! WORLDCLOCK+DATE By Shadow");
	print("--------------------------------------\n");

  SetTimer("settime",1000,true);

	Date = TextDrawCreate(547.000000,11.000000,"--");

	TextDrawFont(Date,3);
	TextDrawLetterSize(Date,0.399999,1.600000);
  TextDrawColor(Date,0xffffffff);

	Time = TextDrawCreate(547.000000,28.000000,"--");

	TextDrawFont(Time,3);
	TextDrawLetterSize(Time,0.399999,1.600000);
	TextDrawColor(Time,0xffffffff);


	SetTimer("settime",1000,true);
	return 1;
}

public OnFilterScriptExit()
{
	print("\n-----------------------------------------------------");
	print(" Update Version! WORLDCLOCK+DATE By Shadow !UNLOADED!");
	print("-----------------------------------------------------/n");
	return 1;
}

public OnPlayerSpawn(playerid)
{
	SendClientMessage(playerid, 0xF97804FF, "This server is running Shadows Worldclock+Date AddOn!");
	TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date);
	

	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	TextDrawHideForPlayer(playerid, Time), TextDrawHideForPlayer(playerid, Date);
	return 1;
}

public settime(playerid)
{
	new string[256],year,month,day,hours,minutes,seconds;
	getdate(year, month, day), gettime(hours, minutes, seconds);
	format(string, sizeof string, "%d/%s%d/%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);
	TextDrawSetString(Date, string);
	format(string, sizeof string, "%s%d:%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);
	TextDrawSetString(Time, string);
}
Reply
#2

Quote:
Originally Posted by BLACK-RIDER-1692
Need Help!

Want Only Date (07/07/2009)
Not Clock (16:24:15)

Plz Change That!
pawn Code:
#include <a_samp>
#define FILTERSCRIPT
new Text:Date;
forward settime(playerid);
pawn Code:
public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Updated Version! WORLDCLOCK+DATE By Shadow");
    print("--------------------------------------\n");

    SetTimer("settime",1000,true);

    Date = TextDrawCreate(547.000000,11.000000,"--");
    TextDrawFont(Date,3);
    TextDrawLetterSize(Date,0.399999,1.600000);
    TextDrawColor(Date,0xffffffff);
    return 1;
}
pawn Code:
public OnPlayerSpawn(playerid)
{
    SendClientMessage(playerid, 0xF97804FF, "This server is running Shadows Worldclock+Date AddOn!");
    TextDrawShowForPlayer(playerid, Date);
   

    return 1;
}
pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
    TextDrawHideForPlayer(playerid, Date);
    return 1;
}
pawn Code:
public settime(playerid)
{
    new string[256],year,month,day;
    getdate(year, month, day);
    format(string, sizeof string, "%d/%s%d/%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);
    TextDrawSetString(Date, string);

}
Reply
#3

Thank You
Reply
#4

@ happyface

It's nice you are giving him the code but this way he will never learn
Reply
#5

Quote:
Originally Posted by Sneaky.
@ happyface

It's nice you are giving him the code but this way he will never learn
If he really wants to learn, he will learn by taking a look at this code, how was it made and stuff...But if he'll just copy/paste the code, he won't learn nothing at all, so it's up to him.
Reply
#6

Or you could point him into the right direction :P that way he will try to modify it and actually look at the code, because trust me he will just copy yours without even looking at it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)