Command causes alot of errors
#1

Hello, I have made a command but did I over see something because it gives me tons of errors

PHP код:
CMD:aduty(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 2)
    {
    if (!
AdminDuty[playerid])
    {
        
PlayerInfo[playerid][pAdminDuty] = 1;
        
SendClientMessageEx(playeridCOLOR_GRAD2"You are now Off-Duty.");
    }
    else
    {
        
PlayerInfo[playerid][pAdminDuty] = 0;
        
SendClientMessageEx(playeridCOLOR_GRAD2"You are now On-Duty.");
    }
    else
    {
        
SendClientMessageEx(playeridCOLOR_GRAD1"You are not authorized to use that command.");
    }
    return 
1;

Reply
#2

What kind of errors? is the compiler giving you errors? warnings? Is it crashing the server?
Reply
#3

Quote:
Originally Posted by RedFusion
Посмотреть сообщение
What kind of errors? is the compiler giving you errors? warnings? Is it crashing the server?
I is giving me tons of MySQL errors witch doesn't make any sense If I disable the command everything is okay so it is the Aduty command I just made..
Reply
#4

if its not an missed bracket above, try this
Код:
CMD:aduty(playerid, params[])
{
    if(Adminlevelofplayer[playerid] == 0) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
    	if (!AdminDuty[playerid])
        {
        	PlayerInfo[playerid][pAdminDuty] = 1;
        	SendClientMessageEx(playerid, COLOR_GRAD2, "You are now Off-Duty.");
 	}
    	else
	{
        	PlayerInfo[playerid][pAdminDuty] = 0;
        	SendClientMessageEx(playerid, COLOR_GRAD2, "You are now On-Duty.");
	{
    }
    return 1;
}
And send your errors if that doesn't help you
Reply
#5

Quote:
Originally Posted by AstroPoid
Посмотреть сообщение
if its not an missed bracket above, try this
Код:
CMD:aduty(playerid, params[])
{
    if(Adminlevelofplayer[playerid] == 0) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
    	if (!AdminDuty[playerid])
        {
        	PlayerInfo[playerid][pAdminDuty] = 1;
        	SendClientMessageEx(playerid, COLOR_GRAD2, "You are now Off-Duty.");
 	}
    	else
	{
        	PlayerInfo[playerid][pAdminDuty] = 0;
        	SendClientMessageEx(playerid, COLOR_GRAD2, "You are now On-Duty.");
	{
    }
    return 1;
}
And send your errors if that doesn't help you
What is if(Adminlevelofplayer[playerid] == 0) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
Reply
#6

Quote:
Originally Posted by SacrificeGaming
Посмотреть сообщение
What is if(Adminlevelofplayer[playerid] == 0) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
Replace
Код:
Adminlevelofplayer[playerid]
with the code which you are defining admin levels with
Reply
#7

I must have missed a bracket since it still gives me tons of unnecessary errors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)