Custom function isn't working
#1

pawn Code:
stock GetTimeEx(&Hour, &Minute, &Second)
{
    gettime(Hour, Minute, Second);
    new s[3], m[3];
    format(s, sizeof(s), "%d", Second);
    format(m, sizeof(m), "%d", Minute);
    if(strlen(s) == 1)
    {
      new Second2[3];
      format(Second2, sizeof(Second2), "0%d", Second);
      Second = strval(Second2);
    }
    if(!strlen(s))
    {
      new Second2[3];
      format(Second2, sizeof(Second2), "00");
      Second = strval(Second2);
    }
    if(strlen(m) == 1)
    {
      new Minute2[3];
      format(Minute2, sizeof(Minute2), "0%d", Minute);
      Minute = strval(Minute2);
    }
    if(!strlen(m))
    {
      new Minute2[3];
      format(Minute2, sizeof(Minute2), "00", Minute);
      Minute = strval(Minute2);
    }
}
I made it because I was annoyed that if the time was for example 14:02:05 gettime would say 14:2:5. Do I need to return something at the end?
Reply


Messages In This Thread
Custom function isn't working - by biltong - 08.04.2010, 14:10
Re: Custom function isn't working - by M4S7ERMIND - 08.04.2010, 14:13
Re: Custom function isn't working - by biltong - 08.04.2010, 14:18
Re: Custom function isn't working - by Miguel - 08.04.2010, 14:21
Re: Custom function isn't working - by M4S7ERMIND - 08.04.2010, 14:25
Re: Custom function isn't working - by biltong - 08.04.2010, 14:31
Re: Custom function isn't working - by M4S7ERMIND - 08.04.2010, 15:09
Re: Custom function isn't working - by biltong - 08.04.2010, 18:05

Forum Jump:


Users browsing this thread: 1 Guest(s)