/skin problem
#1

PHP код:
CMD:skin(playerid,params[])
{
    new 
skinnumberskinidstring[128];
    if(
sscanf(params"d"skinid)) SendClientMessage(playerid, -1"{/skin <skinid>");
    else if(
skinid || skinid 308SendClientMessage(playerid0xFF0000FF"Choose a skin between 0 to 308!");
    
SetPlayerSkin(playeridskinid);
    
skinnumber GetPlayerSkin(playerid);
    
format(stringsizeof(string), "You have changed your skin to %d."skinnumber);
    
SendClientMessage(playerid, -1string);
    if(
PlayerInfo[playerid][pAdmin] <= 3) return SendClientMessage(playerid0xFF0000FF"You have no acces to this command."); //return this message
    
return 1;
 } 
If player have admin lower than 3, he get message "You have no acces to this command." but get the skin.
Reply
#2

Try to put the line:

Quote:

if(PlayerInfo[playerid][pAdmin] <= 3) return SendClientMessage(playerid, 0xFF0000FF, "You have no acces to this command."); //return this message

Right under:

Quote:

new skinnumber, skinid, string[128];

Reply
#3

Ty, and anything else, if i use just /skin, i get skin 0.
Reply
#4

Код:
CMD:skin(playerid,params[]) 
{ 
    if(PlayerInfo[playerid][pAdmin] <= 3) 
        return SendClientMessage(playerid, 0xFF0000FF, "You have no acces to this command.");

    new skinid, 
          string[128]; 

    if(sscanf(params, "d", skinid)) {
        SendClientMessage(playerid, -1, "{/skin <skinid>");
        return 1;
    } 
    if(skinid < 0 || skinid > 308) {
        SendClientMessage(playerid, 0xFF0000FF, "Choose a skin between 0 to 308!"); 
        return 1;
    }    
    SetPlayerSkin(playerid, skinid); 
    format(string, sizeof(string), "You have changed your skin to %d.", skinid); 
    SendClientMessage(playerid, -1, string); 
   
    return 1; 
 }
Reply
#5

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?
Reply
#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
#7

Thank you!
Can you help me with something else?
1.When i die, i instantly get respawned, i don't see that 3 sec video dead you know?
2.Can you show me what do when player connect to don't have name colored and don't see that little colored square?
Reply
#8

Quote:
Originally Posted by zT KiNgKoNg
Посмотреть сообщение
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;
}


You are aware that there's 312 skins not 308.
I have only modified to fix his problem
Reply
#9

Can you guys help me with those things?
Reply
#10

Quote:
Originally Posted by GabiXx
Посмотреть сообщение
Thank you!
Can you help me with something else?
1.When i die, i instantly get respawned, i don't see that 3 sec video dead you know?
2.Can you show me what do when player connect to don't have name colored and don't see that little colored square?
1:Check under OnPlayerDeath, you're probably forcing him to spawn, if you are then don't.

2.me no understand that. if you want to hide his marker use SetPlayerMarkerForPlayer
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)