SA-MP Forums Archive
setalltime cmd not working [+rep] - 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)
+--- Thread: setalltime cmd not working [+rep] (/showthread.php?tid=562611)



setalltime cmd not working [+rep] - HydraHumza - 10.02.2015

Solved!


Re: setalltime cmd not working [+rep] - CalvinC - 10.02.2015

Could you explain why it is not working? What happens?
Also, it is better to use sscanf with zcmd instead of strval.


Re: setalltime cmd not working [+rep] - LMaxCo - 10.02.2015

pawn Код:
CMD:setalltime(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 4) {
        if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /setalltime [hour]");
        new var = strval(params), string[128];
        if(var > 24) return SendClientMessage(playerid, red, "ERROR: Invalid hour");
        CMDMessageToAdmins(playerid,"SETALLTIME");
        for(new i = 0; i < MAX_PLAYERS; i++) {
            if(IsPlayerConnected(i)) {
                PlayerPlaySound(i,1057,0.0,0.0,0.0);
                SetPlayerTime(i, var, 0);
            }
        }
        format(string,sizeof(string),"Administrator \"%s\" has set all players time to '%d:00'", pName(playerid), var );
        return SendClientMessageToAll(blue, string);
    } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Try This Maybe Help You


Re: setalltime cmd not working [+rep] - HydraHumza - 10.02.2015

it works perfect but actually it not change server time

For example i do

/setalltime 12 it say it change but the time not and the time and weather is be like same


Re: setalltime cmd not working [+rep] - LMaxCo - 10.02.2015

Try /setalltime 12:00 LoL :V


Re: setalltime cmd not working [+rep] - HydraHumza - 10.02.2015

Quote:
Originally Posted by LMaxCo
Посмотреть сообщение
pawn Код:
CMD:setalltime(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 4) {
        if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /setalltime [hour]");
        new var = strval(params), string[128];
        if(var > 24) return SendClientMessage(playerid, red, "ERROR: Invalid hour");
        CMDMessageToAdmins(playerid,"SETALLTIME");
        for(new i = 0; i < MAX_PLAYERS; i++) {
            if(IsPlayerConnected(i)) {
                PlayerPlaySound(i,1057,0.0,0.0,0.0);
                SetPlayerTime(i, var, 0);
            }
        }
        format(string,sizeof(string),"Administrator \"%s\" has set all players time to '%d:00'", pName(playerid), var );
        return SendClientMessageToAll(blue, string);
    } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Try This Maybe Help You
not working


Re: setalltime cmd not working [+rep] - LMaxCo - 10.02.2015

Why I Can Use It To My Server? Maybe You Dont Know How To Use That Command, Try /setalltime 00:00


Re: setalltime cmd not working [+rep] - HydraHumza - 10.02.2015

i know how to use that command but this cmd is not working


Re: setalltime cmd not working [+rep] - Rog - 10.02.2015

Код:
CMD:setalltime(playerid,params[]) {
	if(PlayerInfo[playerid][Level] >= 4) {
	    if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /setalltime [hour]");
		new var = strval(params), string[128];
		if(var > 24) return SendClientMessage(playerid, red, "ERROR: Invalid hour");
       	CMDMessageToAdmins(playerid,"SETALLTIME");
		for(new i = 0; i < MAX_PLAYERS; i++) {
			if(IsPlayerConnected(i)) {
				PlayerPlaySound(i,1057,0.0,0.0,0.0);
				SetPlayerTime(i, var, 0);
			}
		}
		format(string,sizeof(string),"Administrator \"%s\" has set all players time to '%d:00'", pName(playerid), var );
		return SendClientMessageToAll(blue, string);
	} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Try This.


Re: setalltime cmd not working [+rep] - HydraHumza - 10.02.2015

Quote:
Originally Posted by Rog
Посмотреть сообщение
Код:
CMD:setalltime(playerid,params[]) {
	if(PlayerInfo[playerid][Level] >= 4) {
	    if(isnull(params)) return SendClientMessage(playerid, red, "USAGE: /setalltime [hour]");
		new var = strval(params), string[128];
		if(var > 24) return SendClientMessage(playerid, red, "ERROR: Invalid hour");
       	CMDMessageToAdmins(playerid,"SETALLTIME");
		for(new i = 0; i < MAX_PLAYERS; i++) {
			if(IsPlayerConnected(i)) {
				PlayerPlaySound(i,1057,0.0,0.0,0.0);
				SetPlayerTime(i, var, 0);
			}
		}
		format(string,sizeof(string),"Administrator \"%s\" has set all players time to '%d:00'", pName(playerid), var );
		return SendClientMessageToAll(blue, string);
	} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
}
Try This.
i try but its not working for me