SA-MP Forums Archive
Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Problem (/showthread.php?tid=374369)



Problem - yLuSsSIoN - 02.09.2012

So i got a problem with any clock filterscript , i try to put clocks ( around ten ) and nothing works , i add it on filterscript folder and filterscript line in server.cfg
I loaded it in the game , restart the server but nothing , pleaze help.
+rep who helps me


Re: Problem - yLuSsSIoN - 02.09.2012

Someone pleaze ??


Re: Problem - HuSs3n - 02.09.2012

write some more info ,and show your script


Re: Problem - yLuSsSIoN - 02.09.2012

http://pastebin.com/zYPRahpf
This is the clock


Re: Problem - Misiur - 02.09.2012

I didn't read the full code yet, but FYI:
pawn Код:
format(str, sizeof str, "%2d", someinteger)
Makes the number to be always 2 chars wide, so it will add preceding 0 if < 10.

Also - OnFilterScriptInit is for filterscripts, OnGameModeInit is for gamemodes


Re: Problem - yLuSsSIoN - 02.09.2012

I try it , but still not working , the problem is : Any clock i put , doesnt work..


Re: Problem - yLuSsSIoN - 03.09.2012

Anyone pleaze ?


Re: Problem - Misiur - 03.09.2012

pawn Код:
public settime(playerid)
//Change to
public settime()
You aren't passing the arugment with timer, so why keep it there? Little by little we will find out what's wrong.

`e: Ok, big chunk

pawn Код:
#include <a_samp>
#include <time>
#define FILTERSCRIPT
forward settime(playerid);
new Text:Time2, Text:Date;

public settime()
{
    new string[256],year,month,day,hours,minutes,seconds;
    getdate(year, month, day), gettime(hours, minutes, seconds);
    format(string, sizeof string, "~r~%2d/~y~%2d/~b~%d", day, month, year);
    TextDrawSetString(Date, string);
    format(string, sizeof string, "~r~%2d:~y~%2d:~b~%2d", hours, minutes, seconds);
    TextDrawSetString(Time2, string);
}
public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, Time2);
    TextDrawShowForPlayer(playerid, Date);
    return 1;
}
public OnGameModeInit()
{
    Date = TextDrawCreate(547.000000,11.000000,"--");
    TextDrawFont(Date,3);
    TextDrawLetterSize(Date,0.399999,1.600000);
    TextDrawColor(Date,0xffffffff);
    Time2 = TextDrawCreate(547.000000,28.000000,"--");
    TextDrawFont(Time2,3);
    TextDrawLetterSize(Time2,0.399999,1.600000);
    TextDrawColor(Time2,0xffffffff);
    SetTimer("settime",1000,true);
    return 1;
}



Re: Problem - yLuSsSIoN - 03.09.2012

Ok i will try as you say .
Edit : Ty so much :X it worked !!

1 More question , the date is a bit in the Right part , how i can move it a bit to the left?


Re: Problem - [MM]RoXoR[FS] - 03.09.2012

Quote:
Originally Posted by yLuSsSIoN
Посмотреть сообщение
Ok i will try as you say .
Edit : Ty so much :X it worked !!

1 More question , the date is a bit in the Right part , how i can move it a bit to the left?
Код:
TextDrawCreate(547.000000,11.000000,"--");
Change 547 to a lower value to make it left,
Change 547 to a higher to make it right,
Change 11 to lower to make it up,
Change 11 to higher to make it down.