[FilterScript] Speedo/Date/Time/Ping/ServerName
#1



Hello , to day i finished this script



Screenshot


Credits

JonyNguyen

iPLEOMAX (Icons and some functions from his editor: https://sampforum.blast.hk/showthread.php?tid=376758)

zcmd (Zeex: https://sampforum.blast.hk/showthread.php?tid=91354)
Code:
- /Speedo_on is turn on speed clock
- /Speedo_off is turn off speed clock


PHP Code:
#include <a_samp>
#include <zcmd>
#define FILTERSCRIPT
#define VERSION "1.0"
#define COLOR_LIGHTBLUE 0x33CCFFAA
new Text:TimeText:CayText:PingText:FPSText:Textdraw1Text:Textdraw3Text:Textdraw4Text:SpeedText:Textdraw2Text:Date;
new 
pFPS[MAX_PLAYERS];
forward settime(playerid);

public 
OnFilterScriptInit()
{
        print(
" --------------------------------------");
        print(
" Speedometer , Date , Time , Ping , FPS : JonyNguyen Version "VERSION"!!!");
        print(
"-------------------------------------- ");


        
SetTimer("settime",1000,true);

        
Speed TextDrawCreate(490.000000160.000000"--");
        
TextDrawBackgroundColor(Speed255);
        
TextDrawFont(Speed1);
        
TextDrawLetterSize(Speed0.3500001.200000);
        
TextDrawColor(Speed, -1);
        
TextDrawSetOutline(Speed1);
        
TextDrawSetProportional(Speed1);
        
TextDrawSetSelectable(Speed0);

        
Textdraw1 TextDrawCreate(544.000000361.000000"~r~-");
        
TextDrawBackgroundColor(Textdraw1255);
        
TextDrawFont(Textdraw12);
        
TextDrawLetterSize(Textdraw10.2900001.200000);
        
TextDrawColor(Textdraw1, -1);
        
TextDrawSetOutline(Textdraw11);
        
TextDrawSetProportional(Textdraw11);
        
TextDrawSetSelectable(Textdraw10);

        
Textdraw2 TextDrawCreate(560.000000373.000000"~r~-");
        
TextDrawBackgroundColor(Textdraw2255);
        
TextDrawFont(Textdraw21);
        
TextDrawLetterSize(Textdraw20.2100001.200000);
        
TextDrawColor(Textdraw2, -16776961);
        
TextDrawSetOutline(Textdraw21);
        
TextDrawSetProportional(Textdraw21);
        
TextDrawSetSelectable(Textdraw20);

        
Textdraw3 TextDrawCreate(527.000000384.000000"-");
        
TextDrawBackgroundColor(Textdraw3255);
        
TextDrawFont(Textdraw31);
        
TextDrawLetterSize(Textdraw35.0000001.000000);
        
TextDrawColor(Textdraw3, -1);
        
TextDrawSetOutline(Textdraw30);
        
TextDrawSetProportional(Textdraw31);
        
TextDrawSetShadow(Textdraw31);
        
TextDrawSetSelectable(Textdraw30);
        
        
Textdraw4 TextDrawCreate(521.000000392.000000"********.com/naqui9x");
        
TextDrawBackgroundColor(Textdraw4, -1);
        
TextDrawFont(Textdraw41);
        
TextDrawLetterSize(Textdraw40.2300001.200000);
        
TextDrawColor(Textdraw4255);
        
TextDrawSetOutline(Textdraw41);
        
TextDrawSetProportional(Textdraw41);
        
TextDrawSetSelectable(Textdraw40);


        
Ping TextDrawCreate(524.000000374.000000"--");
        
TextDrawBackgroundColor(Ping255);
        
TextDrawFont(Ping1);
        
TextDrawLetterSize(Ping0.2000001.200000);
        
TextDrawColor(Ping, -16776961);
        
TextDrawSetOutline(Ping1);
        
TextDrawSetProportional(Ping1);
        
TextDrawSetSelectable(Ping0);

        
FPS TextDrawCreate(570.000000374.000000"--");
        
TextDrawBackgroundColor(FPS255);
        
TextDrawFont(FPS1);
        
TextDrawLetterSize(FPS0.2000001.200000);
        
TextDrawColor(FPS, -16776961);
        
TextDrawSetOutline(FPS1);
        
TextDrawSetProportional(FPS1);
        
TextDrawSetSelectable(FPS0);


        
Date TextDrawCreate(552.000000361.000000,"--");
        
TextDrawBackgroundColor(Date255);
        
TextDrawFont(Date2);
        
TextDrawLetterSize(Date0.2000001.200000);
        
TextDrawColor(Date, -1);
        
TextDrawSetOutline(Date1);
        
TextDrawSetProportional(Date1);
        
TextDrawSetSelectable(Date0);

        
Time TextDrawCreate(516.000000361.000000,"--");
        
TextDrawBackgroundColor(Time255);
        
TextDrawFont(Time2);
        
TextDrawLetterSize(Time0.2000001.200000);
        
TextDrawColor(Time, -1);
        
TextDrawSetOutline(Time1);
        
TextDrawSetProportional(Time1);
        
TextDrawSetSelectable(Time0);

        
Cay TextDrawCreate(487.000000344.000000"~r~V~w~ietnam~r~R~w~oleplay");
        
TextDrawBackgroundColor(Cay255);
        
TextDrawFont(Cay1);
        
TextDrawLetterSize(Cay0.5099991.600000);
        
TextDrawColor(Cay, -1);
        
TextDrawSetOutline(Cay1);
        
TextDrawSetProportional(Cay1);
        
TextDrawSetSelectable(Cay0);
        return 
1;
}

public 
OnFilterScriptExit()
{
        return 
1;
}

public 
OnPlayerSpawn(playerid)
{
        
TextDrawShowForPlayer(playeridTime), TextDrawShowForPlayer(playeridDate), TextDrawShowForPlayer(playeridCay), TextDrawShowForPlayer(playeridPing), TextDrawShowForPlayer(playeridFPS), TextDrawShowForPlayer(playeridTextdraw1), TextDrawShowForPlayer(playeridTextdraw2), TextDrawShowForPlayer(playeridTextdraw3), TextDrawShowForPlayer(playeridTextdraw4);


        return 
1;
}

public 
OnPlayerDisconnect(playeridreason)
{
        
TextDrawHideForPlayer(playeridTime), TextDrawHideForPlayer(playeridDate), TextDrawHideForPlayer(playeridCay), TextDrawHideForPlayer(playeridPing), TextDrawHideForPlayer(playeridFPS), TextDrawHideForPlayer(playeridTextdraw1), TextDrawHideForPlayer(playeridTextdraw2), TextDrawHideForPlayer(playeridTextdraw3), TextDrawHideForPlayer(playeridTextdraw4);
        return 
1;
}

public 
settime(playerid)
{
        new 
string[256],year,month,day,hours,minutes,seconds;
        
getdate(yearmonthday), gettime(hoursminutesseconds);
        
format(stringsizeof string"%d/%s%d/%s%d"day, ((month 10) ? ("0") : ("")), month, (year 10) ? ("0") : (""), year);
        
TextDrawSetString(Datestring);
        
format(stringsizeof string"%s%d:%s%d", (hours 10) ? ("0") : (""), hours, (minutes 10) ? ("0") : (""), minutes, (seconds 10) ? ("0") : (""), seconds);
        
TextDrawSetString(Timestring);
        
format(stringsizeof string"~r~Ping: ~w~%d"GetPlayerPing(playerid));
        
TextDrawSetString(Pingstring);
        
format(stringsizeof string"~r~LAG: ~w~No"pFPS[playerid]);
        
TextDrawSetString(FPSstring);
        
format(stringsizeof string"~w~SPEED: ~r~%d ~w~KM/h."GetSpeed(playerid));
        
TextDrawSetString(Speedstring);
}

stock GetSpeed(playerid)
{
        new 
FloatPos[4];
        
GetVehicleVelocity(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
        return 
floatround(1.61 floatsqroot(floatabs(floatpower(Pos[0] + Pos[1] + Pos[2], 2))) * 100);
}


CMD:speedo_on(playeridparams[])
{
    if(!
IsPlayerInAnyVehicle(playerid)) {
    return 
SendClientMessage(playeridCOLOR_LIGHTBLUE"** You need to be in a car.");
    }
    
SendClientMessage(playeridCOLOR_LIGHTBLUE"** You\'re turn on speed clock");
    
TextDrawShowForPlayer(playeridText:Speed);
    return 
1;
}

CMD:speedo_off(playeridparams[])
{
    if(!
IsPlayerInAnyVehicle(playerid)) {
    return 
SendClientMessage(playeridCOLOR_LIGHTBLUE"** You need to be in a car.");
    }
    
SendClientMessage(playeridCOLOR_LIGHTBLUE"** You\'re turn off speed clock.");
    
TextDrawHideForPlayer(playeridText:Speed);
    return 
1;
}

public 
OnPlayerExitVehicle(playeridvehicleid)
{
    
TextDrawHideForPlayer(playeridText:Speed);
    return 
1;

Sorry for my bad english
Reply


Messages In This Thread
Speedo/Date/Time/Ping/ServerName - by JonyNguyen - 31.10.2014, 14:25
Re: Speedo/Date/Time/Ping/ServerName - by JonyNguyen - 31.10.2014, 15:02
Re: Speedo/Date/Time/Ping/ServerName - by Steel_ - 31.10.2014, 15:45
Re: Speedo/Date/Time/Ping/ServerName - by Flashhiee - 31.10.2014, 15:50
Re: Speedo/Date/Time/Ping/ServerName - by Alex Magaсa - 31.10.2014, 16:00
Re: Speedo/Date/Time/Ping/ServerName - by JonyNguyen - 31.10.2014, 17:07
Re: Speedo/Date/Time/Ping/ServerName - by M0HAMMAD - 31.10.2014, 18:41
Re: Speedo/Date/Time/Ping/ServerName - by VinPure - 01.11.2014, 02:28
Re: Speedo/Date/Time/Ping/ServerName - by JonyNguyen - 01.11.2014, 05:32
Re: Speedo/Date/Time/Ping/ServerName - by Pottus - 01.11.2014, 05:36
Re: Speedo/Date/Time/Ping/ServerName - by AdmBot - 01.11.2014, 06:42
Re: Speedo/Date/Time/Ping/ServerName - by Zeddclarity - 01.11.2014, 10:45
Re: Speedo/Date/Time/Ping/ServerName - by VinPure - 01.11.2014, 10:50

Forum Jump:


Users browsing this thread: 1 Guest(s)