/skin problem
#6

Quote:
Originally Posted by GabiXx
Посмотреть сообщение
Can you show me how to make this for admin?
PHP код:
CMD:healme(playeridparams [])
{
      
SetPlayerHealth(playerid100);
      if(
PlayerInfo[playerid][pAdmin] <=) return SendClientMessage(playerid0xFF0000FF"You have no acces to this command."); //return this message
      
return 1;

I put this and if player is not admin lvl x, he get hp, and get message too.
And i want this for admin level 1 and level 1 +, no just 1+, you know?
Hey Gabi, here you go (Note: I just threw this together, and cannot say it works (it should); And its 1:10).
Note: The define "IsAdmin" is just me being clean, and I've always preferred this method to clean my code up a little.

pawn Код:
#define IsAdmin(%0,%1)  PlayerInfo[%0][pAdmin] >=%1

CMD:healme(playerid, params [])
{
    if(IsAdmin(playerid, 1))
    {
        new Float:SetHealth;
        if(sscanf(params, "f", SetHealth))
            return // USAGE MESSAGE EG SendClientMessage(playerid, 0xFFFFFFFF, "[Usage]: /healme [amount]");
        if(SetHealth < 1 || SetHealth > 100)
            return // ERROR MESSAGE EG SendClientMessage(playerid, 0xFFFFFFFF, "[ERROR]: The value cannot be above 100 or below 1");
        SetPlayerHealth(playerid, SetHealth);
    } else
        // Error message here
    return true;
}
Quote:
Originally Posted by Heagab
Посмотреть сообщение
Код:
CMD:skin(playerid,params[])
{
    if(PlayerInfo[playerid][pAdmin] <= 3) return SendClientMessage(playerid, 0xFF0000FF, "You have no acces to this command.");    
    if(isnull(params) || !IsNumeric(params)) return SendClientMessage(playerid, 0xFF0000FF, "Choose a skin between 0 to 308!"); //check if params isnull   
    new skinnumber, skinid, string[128];
    if(sscanf(params, "d", skinid)) SendClientMessage(playerid, -1, "{/skin <skinid>");
    else if(skinid < 0 || skinid > 308) SendClientMessage(playerid, 0xFF0000FF, "Choose a skin between 0 to 308!");
    SetPlayerSkin(playerid, skinid);
    skinnumber = GetPlayerSkin(playerid);
    format(string, sizeof(string), "You have changed your skin to %d.", skinnumber);
    SendClientMessage(playerid, -1, string);
    return 1;
}
You are aware that there's 312 skins not 308.
Reply


Messages In This Thread
/skin problem - by GabiXx - 01.08.2015, 23:40
Re: /skin problem - by Dragonic - 01.08.2015, 23:42
Re: /skin problem - by GabiXx - 01.08.2015, 23:50
Re: /skin problem - by prineside - 01.08.2015, 23:55
Re: /skin problem - by GabiXx - 02.08.2015, 00:00
Re: /skin problem - by zT KiNgKoNg - 02.08.2015, 00:08
Re: /skin problem - by GabiXx - 02.08.2015, 00:15
Re: /skin problem - by Heagab - 02.08.2015, 00:15
Re: /skin problem - by GabiXx - 02.08.2015, 00:30
Re: /skin problem - by xVIP3Rx - 02.08.2015, 01:19

Forum Jump:


Users browsing this thread: 3 Guest(s)