SA-MP Forums Archive
help fix command - 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: help fix command (/showthread.php?tid=619818)



help fix command - kevin132312 - 22.10.2016

CMDetalltime(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 3) {
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");
}

Nothing change /setalltime 1-24


Re: help fix command - Micko123 - 22.10.2016

PHP код:
CMD:setalltime(playerid,params[])
{
    if(
PlayerInfo[playerid][Level] >= 3)
    {
        new 
time;
        if(
sscanf(params "i"time))
        {
            
SendClientMessage(playeridred"Usage: /settimeall [hour] ");
            return 
1;
        }
        if(
time 24) return SendClientMessage(playeridred"ERROR: Invalid hour");
        
CMDMessageToAdmins(playerid,"SETALLTIME");
        for(new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i))
            {
                
PlayerPlaySound(i,1057,0.0,0.0,0.0);
                
SetPlayerTime(itime 0);
            }
        }
        new 
string[65];
        
format(stringsizeof(string), "Administrator \"%s\" has set all players time to '%d:00'"pName(playerid), time);
        return 
SendClientMessageToAll(bluestring);
    }
    else return 
SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");

Tell me if is something wrong


Re: help fix command - kevin132312 - 22.10.2016

C:\Users\USER\Desktop\codww.pwn(15162) : error 001: expected token: ",", but found "-string-"
C:\Users\USER\Desktop\codww.pwn(15162) : warning 215: expression has no effect
C:\Users\USER\Desktop\codww.pwn(15162) : warning 215: expression has no effect
C:\Users\USER\Desktop\codww.pwn(15162) : error 001: expected token: ";", but found ")"
C:\Users\USER\Desktop\codww.pwn(15162) : error 029: invalid expression, assumed zero
C:\Users\USER\Desktop\codww.pwn(15162) : fatal error 107: too many error messages on one line


Re: help fix command - Micko123 - 22.10.2016

Show me that line pls


Re: help fix command - kevin132312 - 22.10.2016




Re: help fix command - Micko123 - 22.10.2016

Dude have you copied my command?? Because i don't see it there..


Re: help fix command - kevin132312 - 22.10.2016




Re: help fix command - Micko123 - 22.10.2016

Instead of this
PHP код:
if(sscanf(params "i"time)) 
put this
PHP код:
if(sscanf(params"i"time)) 
On 15163 line


Re: help fix command - kevin132312 - 22.10.2016


still nothing change , btw can you help me how to delete that < in news box


Re: help fix command - Micko123 - 22.10.2016

Try with removing that IsPlayerConnected(i)

And that < probably is text draw. just delete it