Convert dcmd to zcmd+sscanf
#2

pawn Code:
CMD:setlevel(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, GREY, "You are not an RCON admin!");
   
    new
        pLevel,
        pID
    ;
   
    if(sscanf(params, "dd", pID, pLevel)) return SendClientMessage(playerid, GREY, "USAGE: /setlevel <ID> <Level>");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, GREY, "You have entered an incorrect ID");
   
    new
        pName[MAX_PLAYER_NAME],
        file[56]
    ;
       
    GetPlayerName(pID, pName, sizeof(pName));
   
    format(file, sizeof(file), "gAdmin/Users/%s.txt", pName);
   
    PInfo[pID][Level] = pLevel;
    dini_IntSet(file, "Level", pLevel);

    format(file, sizeof(file), "You have set %s's level to %d", pName, pLevel);
    SendClientMessage(playerid, LIGHTBLUE, file);
    return 1;
}
Reply


Messages In This Thread
Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 17:53
Re: Convert dcmd to zcmd+sscanf - by ]Rafaellos[ - 28.03.2016, 18:10
Re: Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 18:13
Re: Convert dcmd to zcmd+sscanf - by iKevin - 28.03.2016, 18:16
Re: Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 18:21
Re: Convert dcmd to zcmd+sscanf - by ]Rafaellos[ - 28.03.2016, 18:23
Re: Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 18:27
Re: Convert dcmd to zcmd+sscanf - by iKevin - 28.03.2016, 19:31
Re: Convert dcmd to zcmd+sscanf - by luckie12 - 28.03.2016, 19:59
Re: Convert dcmd to zcmd+sscanf - by iKevin - 28.03.2016, 20:03

Forum Jump:


Users browsing this thread: 1 Guest(s)