/settime command
#1

EDIT2L: Is this correct? This will set he's/her time for what he choose?

pawn Код:
CMD:settime( playerid, params[ ] )
{
    new time;
    if( sscanf( params, "i", time ) ) return SendClientMessage( playerid, -1, "Usage: /settime <0-24>" );
    if( time > 24 || time < 0 ) return SendClientMessage( playerid, -1, "Available Hours: 0-24" );
    SetPlayerTime( time );
    return 1;
}
Reply
#2

Quote:
Originally Posted by SaYrOn
Посмотреть сообщение
Well, it should, but is "-1" defined to some colour or what?
-1 is color white
in binary -1 is:
1111 1111 | 1111 1111 | 1111 1111 | 1111 1111


and in HEX is:
0xFFFFFFFF


and if i calculate it from HEX to Binary the result it was this:
F F F F F F F F
1111 1111 | 1111 1111 | 1111 1111 | 1111 1111

because of this -1 is Color White
Reply
#3

^^^^^^ smart ass
Reply
#4

Quote:
Originally Posted by NinjaChicken
Посмотреть сообщение
^^^^^^ smart ass
THNX
Reply
#5

Warning

warning 202: number of arguments does not match definition
warning 202: number of arguments does not match definition
Код:
   SetPlayerTime(time );
Line:

pawn Код:
CMD:settime( playerid, params[ ] )
{
    new time;
    if( sscanf( params, "i", time ) ) return SendClientMessage( playerid, 0xFFFFFFFF, "{FFFF00}Usage: /settime <0-24>" );
    if( time > 24 || time < 0 ) return SendClientMessage( playerid, 0xFFFFFFFF, "{FFFF00}Available Hours: 0-24" );
    SetPlayerTime(time );
    return 1;
}
Reply
#6

wtf you have to use /setalltime
Reply
#7

Because obviusly this function has 3 arguments,and its correct format is:
pawn Код:
SetPlayerTime(playerid,hour,minute);
So basically you only need to change the function line in your command,and it should look like this:
pawn Код:
CMD:settime( playerid, params[ ] )
{
    new time;
    if( sscanf( params, "i", time ) ) return SendClientMessage( playerid, 0xFFFFFFFF, "{FFFF00}Usage: /settime <0-24>" );
    if( time > 24 || time < 0 ) return SendClientMessage( playerid, 0xFFFFFFFF, "{FFFF00}Available Hours: 0-24" );
    SetPlayerTime(playerid,time,0 );
    return 1;
}
Reply
#8

Your SetPlayerTime has argument mismatch.
Reply
#9

if you want to change the time to yourself use
Код:
SetPlayerTimer(playerid, time, 0); // the 0 is the minutes
and if you want to change the world time (to all) use
Код:
SetWorldTime(time);
hope i helped
Reply
#10

pawn Код:
CMD:settime( playerid, params[ ] )
{
    new hour,minute,id;
    if( sscanf( params, "uii", id,hour,minute ) ) return SendClientMessage( playerid, 0xFFFFFFFF, "{FFFF00}Usage: /settime <0-23> <0-59>" );
    if(0 > hour > 23) return SendClientMessage( playerid, 0xFFFFFFFF, "{FFFF00}Available Hours: 0-23" );
    if(0 > minute > 59) return SendClientMessage( playerid, 0xFFFFFFFF, "{FFFF00}Available Minutes: 0-59" );
    return SetPlayerTime(id,hour,minute);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)