Skin Permissions
#1

How can you make a skin with a certain permission that you can't access it, like whitelisting people to join a certain skin?
Reply
#2

Variables.

If a player has a variable of 1, he can use that skin, if not, he can't.

Other method is by looking for a name.
Reply
#3

Can you give like an example of code please..
Reply
#4

PHP код:
new CanUseBallas[MAX_PLAYERS]; 
Then,

PHP код:
public OnPlayerRequestSpawn(playerid)
{
      if(
CanUseBallas[playerid] != 1)
    {
        
SendClientMessage(playerid,COLOR_ERROR,"You can't choose this skin.");
        return 
0;
    }
return 
1;

Reply
#5

And how can you whitelist players with that after?
Reply
#6

You have to make them a member of the specified gang and then you should check if the player is in the gang or not.If he is, then he'll be able to use that skin.

Explaining more fairly:-
1. Make a command for admins so that to give the permissions to a player and save it.
2.When player logs, check if he is requesting that skin and check if he is a member of the gang and if he is, then allow him.

Simple as that.
Reply
#7

PHP код:
enum aInfo
{
        
sLevel
}
public 
OnPlayerDisconnect(playeridreason)
{
           
dini_IntSet(file"SKIN"AccountInfo[playerid][sLevel]);
           return 
1;
}
public 
OnPlayerRequestSpawn(playerid)
{
        if(
gTeam[playerid] == YouTeamNameHere)
     if(
AccountInfo[playerid][sLevel] < 1)
    {
        
GameTextForPlayer(playerid"~r~YOU NEED PERMISSION OF ADMIN"30003);
        return 
false;

Under on your login and register code

AccountInfo[playerid][sLevel] = dini_Int(file, "SKIN");

PHP код:
dcmd_givepermission(playeridparams[])
{
     if(
AccountInfo[playerid][scLevel] < 1SendClientMessage(playeridCOLOR_RED"Invalid Command! Use /cmds To See The General Commands.");
     else
    {
        new 
IDlevel;
        if(
sscanf(params"ii"IDlevel)) SendClientMessage(playeridCOLOR_WHITE"USAGE: /givepermission [playerid] (1) For Promoting (0) For Demoting]");
        else if(
ID == INVALID_PLAYER_IDSendClientMessage(playeridCOLOR_RED"Player is Not Connected.");
        else
        {
        
AccountInfo[ID][sLevel] = level;
        
SendClientMessage(ID, -1"{00FF00}Congratulations {CC99FF}You Are {FFCC00}Promoted {99FF33}To {33CCFF}Use That Skin");
        
SendClientMessage(playerid,COLOR_GREEN,"You Have Gave That Player To Skin Permission!");
    }
    }
    return 
1;


Hope You UnderStand
Reply
#8

if you can, in zcmd, i don't use dcmd
Reply
#9

Quote:
Originally Posted by KillerDVX
Посмотреть сообщение
PHP код:
new CanUseBallas[MAX_PLAYERS]; 
Then,

PHP код:
public OnPlayerRequestSpawn(playerid)
{
      if(
CanUseBallas[playerid] != 1)
    {
        
SendClientMessage(playerid,COLOR_ERROR,"You can't choose this skin.");
        return 
0;
    }
return 
1;

Use a boolean type of variable for that.
Reply
#10

Quote:
Originally Posted by 123bob123
Посмотреть сообщение
if you can, in zcmd, i don't use dcmd

PHP код:
CMD:givepermission(playeridparams[])
{
    new 
levelid;
    if(
sscanf(params"ud"idlevel)) return SendClientMessage(playeridRED"[USAGE]: /givepermission  [playerid] [level]");
    if(!
IsPlayerConnected(id)) return SendClientMessage(playeridRED"Player not found.");
    if(
IsLoggedIn{id} == 0) return SendClientMessage(playeridRED"Player not logged in.");
    if(
IsPlayerAdmin(playerid))
    {
        
PlayerInfo[id][dLevel] = level;
        
format(fstrsizeof(fstr), "You Have Gave %s(%d) Permission To Use That Skin level %d."GetName(id), idlevel);
        
GameTextForPlayer(id,"~r~YOU ~p~ARE ~g~APPROVED~n~ ~w~FOR ~g~SKIN"80003);
        
SendClientMessage(playeridCOLOR_ADMINfstr);
        
format(fstrsizeof(fstr), "Admin %s(%d) Has Gave You Permission To Use That Skin level %d."GetName(playerid), playeridlevel);
        
SendClientMessage(idCOLOR_ADMINfstr);
        
SaveUserStats(id);
    }
    else
    {
        
SendClientMessage(playeridRED"Only Rcon Admin Can Use This Command.");
    }
    return 
true;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)