SA-MP Forums Archive
Score 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Score problem (/showthread.php?tid=267091)



Score problem - tbedy - 07.07.2011

i using vortex script, but i want to put that is SCORe is my playing hours...

because like this i donnt have levels and all are score 0,i want to put that is score mplaying hours.. how to do this!?


Re: Score problem - [SRB]Mario - 07.07.2011

Post in Ex-Yu Languages board,I don't understand what are you talking about...
OFF: Postaj tamo i pomoci cu ti ako znam...neide ti bas Engleski...


Re: Score problem - Kyosaur - 07.07.2011

We have a function to Set a players score and we have multiple ways to track time.

I'll help you, but im not going to do the work for you! Lets see you give it an honest try (maybe using the search bar at the wiki/on these forums) and putting some code together. If you try and just cant manage i'll walk you through working with unix time stamps (and my custom ConvertTime function).


Re: Score problem - Kyosaur - 07.07.2011

Quote:
Originally Posted by [SRB]Mario
Посмотреть сообщение
Post in Ex-Yu Languages board,I don't understand what are you talking about...
OFF: Postaj tamo i pomoci cu ti ako znam...neide ti bas Engleski...
Ummm why are you here then lol? Thats like me going to the Russian board and saying i cant understand shit xD.


Re: Score problem - (SF)Noobanatior - 07.07.2011

post the code you got so we can see

do you mean something like?
pawn Код:
stock timeconvert(Float:Time)
{
    new Float:fTime = floatdiv(Time, 10);
    WorldTime[minutes] = floatround(fTime, floatround_tozero);
    WorldTime[seconds] = floatround(floatmul(fTime - WorldTime[minutes], 60), floatround_tozero);
    WorldTime[mseconds] = floatround(floatmul(floatmul(fTime - WorldTime[minutes], 60) - WorldTime[seconds], 1000), floatround_tozero);
    new time = WorldTime[minutes];
    new tmpbuf[MAX_STRING];
    if(time == 0) {
        format(tmpbuf,sizeof(tmpbuf),"%d.%d seconds ",WorldTime[seconds], WorldTime[mseconds]);
    }
    else if(time > 0 && time < 60) {
        format(tmpbuf,sizeof(tmpbuf),"%d minutes %d.%d seconds",WorldTime[minutes],WorldTime[seconds], WorldTime[mseconds]);
    }
    else {//if(time >= 60) {
        WorldTime[hours] = floatround(floatdiv(WorldTime[minutes],60), floatround_tozero);
        WorldTime[minutes] -= (WorldTime[hours] * 60);
        if(time < 1440){
            format(tmpbuf,sizeof(tmpbuf),"%d hours %d minutes %d.%d seconds",WorldTime[hours],WorldTime[minutes],WorldTime[seconds], WorldTime[mseconds]);
        }
        else {//if(time >= 1440) {
            WorldTime[days] = floatround(floatdiv(WorldTime[hours],24), floatround_tozero);
            WorldTime[hours] -= (WorldTime[days] * 24);
            if(time < 10080) {
                format(tmpbuf,sizeof(tmpbuf),"%d days %d hours %d minutes",WorldTime[days],WorldTime[hours],WorldTime[minutes]);
            }
            else {//if(time >= 10080) {
                WorldTime[weeks] = floatround(floatdiv(WorldTime[days],7), floatround_tozero);
                WorldTime[days] -= (WorldTime[weeks] * 7);
                if(time < 524160) {
                    format(tmpbuf,sizeof(tmpbuf),"%d weeks %d days %d hours %d minutes",WorldTime[weeks],WorldTime[days],WorldTime[hours],WorldTime[minutes]);
                }
                else { //if(time >= 524160) {
                    WorldTime[years] = floatround(floatdiv(WorldTime[weeks],52), floatround_tozero);
                    WorldTime[weeks] -= (WorldTime[years] * 52);
                    format(tmpbuf,sizeof(tmpbuf),"%d years %d weeks %d days %d hours %d minutes",WorldTime[years],WorldTime[weeks],WorldTime[days],WorldTime[hours],WorldTime[minutes]);
                }
            }
        }
    }
    return tmpbuf;
}
?


Re: Score problem - tbedy - 07.07.2011

i mean this..
all my players are score 0

i want to put that they have the score like a playing hours..
so, if i have in /stats 5 playing hours that i have score 5 ...

how to put this!?


Re: Score problem - tbedy - 07.07.2011

i mean this..
all my players are score 0

i want to put that they have the score like a playing hours..
so, if i have in /stats 5 playing hours that i have score 5 ...

how to put this!?