Un-authorized command -
mahdi499 - 23.04.2013
i have made a restart command,the problem is the it keeps telling me that im using an un-authorized command when i type the command ingame,i have the pScripter = 2 Rank ingame and it still tells me im un-authorized,please help me
Код:
CMD:gmx(playerid, params[])
{
if(PlayerInfo[playerid][pScripter] || PlayerInfo[playerid][pAdmin] > 99999) return SendClientMessageEx(playerid, COLOR_GRAD2, "You are not authorized to use this command.");
SetTimer( "Maintenance", 50000, false );
SendClientMessageToAll(COLOR_LIGHTBLUE, "* The Server Will Be Going For Server Maintenance In 50Seconds.");
foreach(Player, i) {
GameTextForPlayer(i, "~y~Scheduled Maintenance 50Seconds", 5000, 3);
}
return 1;
}
Re: Un-authorized command -
Rock - 23.04.2013
You need to verify what pScripter variable should be to be able to use this command.
Like this:
pawn Код:
if(PlayerInfo[playerid][pScripter] > 2 || PlayerInfo[playerid][pAdmin] > 99999)
Re: Un-authorized command -
cessil - 23.04.2013
you're treating the pScripter as a boolean which will return false for a value of 0 or true for any other value so if it equals 2 then it'll return true
Re: Un-authorized command -
rbush12 - 23.04.2013
Quote:
PlayerInfo[playerid][pAdmin] > 99999
|
Thats if they are Greater than 99999
Add a = after the >
Providing your pScripter is = 1 and your Admin Level is 99999
Re: Un-authorized command -
Pottus - 23.04.2013
SetTimer( "Maintenance", 50000, false ); this is not 50 seconds.
Re: Un-authorized command -
mahdi499 - 23.04.2013
i Did that in the earlier Try, and it still didn't work.
I tried also If(PlayerInfo[playerid][pScripter] >= 1 .......
and still gave the same unauthorized
Re: Un-authorized command -
cessil - 23.04.2013
Quote:
Originally Posted by [uL]Pottus
SetTimer( "Maintenance", 50000, false ); this is not 50 seconds.
|
sure it is since it's in milliseconds
also instead of looping through and using GameTextForPlayer you could just use GameTextForAll
Re: Un-authorized command -
Pottus - 23.04.2013
Quote:
Originally Posted by cessil
sure it is since it's in milliseconds
also instead of looping through and using GameTextForPlayer you could just use GameTextForAll
|
No it's not, try running this and you will see that timers have absolutely zero precision I get about 4 seconds longer per minute.
pawn Код:
new TimerTicks;
CMD:testtimer(playerid, arg[])
{
TimerTicks = GetTickCount();
SetTimerEx("TimeTest", 60000, false, "i", playerid);
return 1;
}
forward TimeTest(playerid);
public TimeTest(playerid)
{
TimerTicks = GetTickCount() - TimerTicks;
new line[128];
format(line, sizeof(line), "60000ms timer was actually %i MS", TimerTicks);
SendClientMessage(playerid, 0xFF00FFFF, line);
}
Re: Un-authorized command -
cessil - 23.04.2013
Quote:
Originally Posted by [uL]Pottus
No it's not, try running this and you will see that timers have absolutely zero precision I get about 4 seconds longer per minute.
|
his problem wasn't about precision it's about him not understanding a simple if statement
Quote:
Originally Posted by mahdi499
i Did that in the earlier Try, and it still didn't work.
I tried also If(PlayerInfo[playerid][pScripter] >= 1 .......
and still gave the same unauthorized
|
of course because his pScripter is 2 which is also true so it'll return that message because 2 is greater than 1
Re: Un-authorized command -
mahdi499 - 24.04.2013
Quote:
Originally Posted by cessil
his problem wasn't about precision it's about him not understanding a simple if statement
of course because his pScripter is 2 which is also true so it'll return that message because 2 is greater than 1
|
I made this timer to be just a warning i don't want it to be accurate,and i do know this is not 50 seconds,but all i cared about is sending the message,
Also thanks for explaining why it was giving unauthorized and im really thankful For your help!