16.07.2015, 16:45
How can you make a skin with a certain permission that you can't access it, like whitelisting people to join a certain skin?
new CanUseBallas[MAX_PLAYERS];
public OnPlayerRequestSpawn(playerid)
{
if(CanUseBallas[playerid] != 1)
{
SendClientMessage(playerid,COLOR_ERROR,"You can't choose this skin.");
return 0;
}
return 1;
}
enum aInfo
{
sLevel
}
public OnPlayerDisconnect(playerid, reason)
{
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", 3000, 3);
return false;
}
dcmd_givepermission(playerid, params[])
{
if(AccountInfo[playerid][scLevel] < 1) SendClientMessage(playerid, COLOR_RED, "Invalid Command! Use /cmds To See The General Commands.");
else
{
new ID, level;
if(sscanf(params, "ii", ID, level)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givepermission [playerid] (1) For Promoting (0) For Demoting]");
else if(ID == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_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;
}
CMD:givepermission(playerid, params[])
{
new level, id;
if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, RED, "[USAGE]: /givepermission [playerid] [level]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, RED, "Player not found.");
if(IsLoggedIn{id} == 0) return SendClientMessage(playerid, RED, "Player not logged in.");
if(IsPlayerAdmin(playerid))
{
PlayerInfo[id][dLevel] = level;
format(fstr, sizeof(fstr), "You Have Gave %s(%d) Permission To Use That Skin level %d.", GetName(id), id, level);
GameTextForPlayer(id,"~r~YOU ~p~ARE ~g~APPROVED~n~ ~w~FOR ~g~SKIN", 8000, 3);
SendClientMessage(playerid, COLOR_ADMIN, fstr);
format(fstr, sizeof(fstr), "Admin %s(%d) Has Gave You Permission To Use That Skin level %d.", GetName(playerid), playerid, level);
SendClientMessage(id, COLOR_ADMIN, fstr);
SaveUserStats(id);
}
else
{
SendClientMessage(playerid, RED, "Only Rcon Admin Can Use This Command.");
}
return true;
}