Settime command ?
#1

can anyone help me with a settime command in zcmd.?

pawn Код:
COMMAND:settime(playerid, params[])
{
    new time, Name[24], string[128];
    SendAdminText(playerid, "/settime", params);
        {
    if(APlayerData[playerid][PlayerLevel] < 1)  return SendClientMessage(playerid,-1, "{ff0000}You are not admin");
    GetPlayerName(playerid, Name, sizeof(Name));
    if(sscanf(params, "i", time)) return SendClientMessage(playerid, -1, "Usage: /settime [time]");
    if(time > 24 || time < 0) return SendClientMessage(playerid, -1, "Error: Invalid time!");
    SetWorldTime(time);
    format(string, 128, "{ff0000}Admin %s Has changed the server time", Name);
    SendClientMessageToAll(0xff00FF,string);
    }
    return 1;
};
}
i got this but i want it so that it says admin etc changed the time to hour minute
Reply
#2

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

still doesnt work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)