27.02.2014, 14:29
Hi,
Thanks for taking your time reading this. I'm currently attempting to start up my own server and I'm having some troubles with the following command. I've tried solving it, although I haven't managed to find out what the problem is, and therefore I came here hoping you lads' and gals' could help me out!
Cheers!
Thanks for taking your time reading this. I'm currently attempting to start up my own server and I'm having some troubles with the following command. I've tried solving it, although I haven't managed to find out what the problem is, and therefore I came here hoping you lads' and gals' could help me out!
Код:
CMD:setlevel(playerid,params[]) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-4,"Only rcon admins can set admin levels!");//Checking if the player is rcon admin to set an admin level new id, level;//Creating the id variable to store the selected id and a level variable for the chosen admin level. if(sscanf(params,"ui",id,level)) return SendClientMessage(playerid,-1,"USAGE: /setlevel <id> <level>");//Check if the player inputted a username or id and a admin level. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-4,"That player is not connected!");//Checking if the selected user is connected or not. new file[64],PlayerName[24];//Creating a variable to store the file path, and a variable to store the players name. GetPlayerName(id,PlayerName,sizeof PlayerName);//Retrieving the selected id's name, format(file,sizeof file,"Admin/%s.ini",PlayerName); if(!fexist(file)) return SendClientMessage(playerid,-4,"The specified player is currently not registered");//Checking if the player is not registered PlayerInfo[id][Level] = level; SendClientMessage(playerid,-1,"You have successfully changed the selected user's admin level"); SendClientMessage(id,-1,"Your admin level has successfully been changed, congratulations!"); return 1; }