17.07.2014, 00:01
Sorry, I just realised what a dumb idiot I am. It's like I'm not even thinking lol xD. I managed to do it myself (the "else" that I didn't even notice was needing something to be else for (SendClientMessage).
EDIT: Altough, now that I test it, the SendClientMessage works, but the command itself responds with Unknown command.
Here it is:
There's a warning: 212) : warning 209: function "cmd_promote" should return a value
212 is the last bracket in the code.
EDIT: Altough, now that I test it, the SendClientMessage works, but the command itself responds with Unknown command.
Here it is:
Code:
CMD:promote(playerid,params[]) { new id,level; if(IsPlayerAdmin(playerid)) //this will check if the player is logged into RCON { if(sscanf(params,"ud",id,level))return SendClientMessage(playerid, -1,""COL_LIGHTBLUE"Koristi: /promote [ID] [LVL]"); else { if(level > 5) return SendClientMessage(playerid, -1,""COL_LIGHTBLUE"Ne smijete ici iznad 5!"); else { new INI:File = INI_Open(UserPath(id));//this is the example used in Kush's tut link above, make it fit in your system, note that i've changed the UserPath(playerid) to UserPath(id) to promote the chosen player not yourself INI_WriteInt(File,"Admin",level); // writes the admin level in the ini file and makes the player admin. INI_Close(File); //closes the ini file } } } }
212 is the last bracket in the code.