help command
#2

if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an Admin!");

If I understood good, you want only the admin can use this ? With this, only the RCON Admin will be able to use this cmd.

Whole code:

Код:
CMD:banofflineplayer(playerid, params[]) 
{ 
    new targetname[24], filestring[79];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an Admin!"); 
    if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, -1, "Correct Usage: /banofflineplayer [Player's Name]"); 
    format(filestring, sizeof(filestring), "/Users/%s.ini", targetname); 
    if(!fexist(filestring)) return SendClientMessage(playerid, -1, "Error: The player name you have chosen was not found in our system."); 
    else 
    { 
        new INI:File = INI_Open(filestring); 
        INI_SetTag(File, "data"); 
        INI_WriteInt(File, "Banned", 1); 
        INI_Close(File); 
        new done[128]; 
        format(done, sizeof(done), "You have banned %s", targetname); 
        SendClientMessage(playerid,-1 , done); 
    } 
    return 1; 
}
Reply


Messages In This Thread
help command - by Alvaro89 - 30.11.2014, 17:32
Re: help command - by Dizzle - 30.11.2014, 17:53
Respuesta: help command - by Alvaro89 - 30.11.2014, 18:10

Forum Jump:


Users browsing this thread: 1 Guest(s)