/aduty problem
#1

well i have a /aduty command it works and all, but i have 2 warnings


Код:
if(!strcmp(cmdtext, "/aduty", true)) // By Ellis
	{
      if(PlayerInfo[playerid][pAdmin] > 1)
		    {
		    	new string[128];
		        if(AdminDuty[playerid] == 0)
		        {
		            AdminDuty[playerid] = 1;
		            SetPlayerArmour(playerid, 999);
					SetPlayerHealth(playerid, 999);
					SetPlayerColor(playerid,COLOR_WHITE);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "[SERVER] {109E0E} Admin %s is now on duty admin",sendername);
					SendClientMessage(playerid, COLOR_WHITE, string);
					return 1;
		        }
		        else if(AdminDuty[playerid] == 1)
		        {
		            AdminDuty[playerid] = 0;
		            SetPlayerArmour(playerid, 0);
					SetPlayerHealth(playerid, 100);
					SetPlayerColor(playerid,0xFF0000AA);
					GetPlayerName(playerid, sendername, sizeof(sendername));
					format(string, sizeof(string), "[SERVER] {FF0000}Admin %s is now off duty admin",sendername);
					SendClientMessage(playerid, COLOR_WHITE, string);
					return 1;
		        }
		    }
		    else
		    {
		        SendClientMessage(playerid, COLOR_WHITE, "   You're not the admin !");
      		  return 1;
		}
	    return 1;
	}
    return 0;
}
and the warnings

C:\Documents and Settings\InitialUser\My Documents\Downloads\samp03csvr_R2-2_win32\gamemodes\LVRP.pwn(212) : warning 217: loose indentation
C:\Documents and Settings\InitialUser\My Documents\Downloads\samp03csvr_R2-2_win32\gamemodes\LVRP.pwn(214) : warning 217: loose indentation

line 217 - is the "}" under "return0;"
Reply
#2

If it works, shouldn't worry about the warnings all though they are there for a reason :P

I have the same AoD system as you basically expect mine has a small feature but anyways, I don't get any warnings, I will check my code and see what I can do
Reply
#3

Quote:
Originally Posted by Disturbed-
Посмотреть сообщение
If it works, shouldn't worry about the warnings all though they are there for a reason :P

I have the same AoD system as you basically expect mine has a small feature but anyways, I don't get any warnings, I will check my code and see what I can do
ok thanks, but you know i don't want
to take any risks.. i mean warning means something
Reply
#4

Quote:
Originally Posted by ThePandaDK
Посмотреть сообщение
ok thanks, but you know i don't want
to take any risks.. i mean warning means something
The warnings are loose indentation. This means you haven't indented your code properly. If you are extremley lazy and unorganized use '#pragma tabsize 0'. Otherwise indent correctly.
Reply
#5

AdminDuty[playerid] = 0;
SetPlayerArmour(playerid, 0);
''S''etPlayerHealth(playerid, 999);


See the S? AdminDuty and SetPlayerArmor first letter need to be on the S, Try it.
Reply
#6

Quote:
Originally Posted by Kush
Посмотреть сообщение
The warnings are loose indentation. This means you haven't indented your code properly. If you are extremley lazy and unorganized use '#pragma tabsize 0'. Otherwise indent correctly.
Yea, But Warnings still shouldn't be ignored..
Reply
#7

It's about tabbing. Use the tabs correctly. Try this:
pawn Код:
if(!strcmp(cmdtext, "/aduty", true)) // By Ellis
    {
      if(PlayerInfo[playerid][pAdmin] > 1)
            {
                new string[128];
                if(AdminDuty[playerid] == 0)
                {
                    AdminDuty[playerid] = 1;
                    SetPlayerArmour(playerid, 999);
                    SetPlayerHealth(playerid, 999);
                    SetPlayerColor(playerid,COLOR_WHITE);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "[SERVER] {109E0E} Admin %s is now on duty admin",sendername);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                    return 1;
                }
                else if(AdminDuty[playerid] == 1)
                {
                    AdminDuty[playerid] = 0;
                    SetPlayerArmour(playerid, 0);
                    SetPlayerHealth(playerid, 100);
                    SetPlayerColor(playerid,0xFF0000AA);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "[SERVER] {FF0000}Admin %s is now off duty admin",sendername);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                    return 1;
                }
            }
            else
            {
            SendClientMessage(playerid, COLOR_WHITE, "   You're not the admin !");
            return 1;
        }
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)