Little Help with Time Command.
#1

Hello Everyone ! I want to Change my Admin Command Like /setplayertime playerid time to
/setalltime time.

That means I want to Change the Time of All. My Gamemode have a Command of Changing Player Time Can Someone Convert it to World Time Please.
As This Written in dcmd I want in dcmd. Don't Put zcmd command please....
Heres my command of Changing time of a player-
Код:
dcmd_setptime(playerid,params[])
{
	#pragma unused params
    new ID;
    new Level;
    new string[128];
    if(sscanf(params,"ui",ID,Level))
    {
        SendClientMessage(playerid, COLOR_ERROR,"{CACA00}[INFO]{FFFFFF}: /setptime [PlayerID] [Time]");
        return 1;
    }
    if(!IsPlayerConnected(ID))
    {
	 	format(string,sizeof(string),"The player ID (%d) is not connected to the server.",ID);
	 	SendClientMessage(playerid,COLOR_RED,string);
	 	return 1;
	}
	format(string, sizeof(string), "You have set %s's Playing Time to %d",PlayerName(ID),Level);
	SendClientMessage(playerid,COLOR_ADMIN,string);
	format(string,sizeof(string),"Admin %s has set your Playing Time to %d", PlayerName(playerid), Level);
	SendClientMessage(ID,COLOR_ADMIN,string);
	PlayerPlayingTimeHour[ID] =Level;
	return 1;
}
Convert the COde so i can set the world time not playertime Example - /setworldtime time
I Know there is no IsPlayerAdmin Etc, Don't Put this I Already have.
Reply
#2

pawn Код:
dcmd_setworldtime(playerid, params[])
{
    #pragma unused params
    new Level;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            PlayerPlayingTimeHour[i] = Level;
        }
        new string[128];
        format(string, 128, "|- Administrator %s has setted %s hours to all players -|"); // Put here your name variables, etc
        return SendClientMessageToAll(-1, string);
    }
    return 1;
}
Reply
#3

1 Warning -
C:\Users\User\Desktop\gamemodes\ls.pwn(13519) : warning 203: symbol is never used: "playerid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#4

pawn Код:
dcmd_setalltime(playerid,params[])
{
    #pragma unused params
    new Level;
    new string[128];
    if(sscanf(params,"i",Level))
    {
        SendClientMessage(playerid, COLOR_ERROR,"{CACA00}[INFO]{FFFFFF}: /setalltime [Time]");
        return 1;
    }
    for(new i;i!=MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            format(string,sizeof(string),"Admin %s has set your Playing Time to %d", PlayerName(playerid), Level);
            SendClientMessage(ID,COLOR_ADMIN,string);
            PlayerPlayingTimeHour[ID] =Level;
        }
    }
    format(string, sizeof(string), "You have set all connected players Playing Time to %d",Level);
    SendClientMessage(playerid,COLOR_ADMIN,string);
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(setalltime, 10, cmdtext);
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)