10.03.2014, 16:10
I can show you how i would do it.
In this Example i use dini and sscanf
In this Example i use dini and sscanf
Код:
CMD:oban(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 4) { SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!"); return 1; } if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6) { SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty."); return 1; } new username[24],reason[64],string[128]; if(sscanf(params,"s[24]s[64]",username,reason)) return SendClientMessage(playerid,COLOR_GRAD1,"Useage: /oban username reason"); if(doesAccountExist(username)) { new UserFile[24]; format(UserFile,sizeof(UserFile),"/Account/%s.ini",username); dini_IntSet(UserFile,"Ban",1); format(string,sizeof(string),"User %s was banned from this Server",username); SendClientMessageToAll(COLOR_WHITE,string); } return 1; } stock doesAccountExist(user[]) { new UserFile[24]; format(UserFile,sizeof(UserFile),"/Account/%s.ini",user); if(dini_Exists(UserFile)) return 1; return 0; }