How would i do reserved skins?
#1

How would i make a reserved skin, so its reserved for a certain player in the class selection list.
Reply
#2

Look
OnPlayerRequestClass
Reply
#3

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerSkin(playerid) == 294) // Wu-Zi-Mu
    {
        if(strcmp(name, "JAMMIEISFTW", false)) //Name, do not ignore case
        {
            GameTextForPlayer(playerid, "~r~Restricted skin!", 3000, 5);
            return 0; //Stop spawning
        }
    }
}
Or even

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerSkin(playerid) == 0) // CJ
    {
        if(!IsPlayerAdmin(playerid)) //Are they RCON admin? If not...
        {
            GameTextForPlayer(playerid, "~r~Restricted skin!", 3000, 5);
            return 0; //...Stop spawning
        }
    }
}
Reply
#4

But how do i do it so its ONLY For a certain player name?
Reply
#5

The first one. Just change the name.

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerSkin(playerid) == 294) // Wu-Zi-Mu
    {
        new name[24]; GetPlayerName(playerid, name, 24);
        if(strcmp(name, "JAMMIEISFTW", false)) //Name, do not ignore case
        {
            GameTextForPlayer(playerid, "~r~Restricted skin!", 3000, 5);
            return 0; //Stop spawning
        }
    }
}
pawn Код:
if(strcmp(name, "JAMMIEISFTW", false)) //Name, do not ignore case
Reply
#6

C:\Users\Public\Documents\neww\gamemodes\SFCRRPG.p wn(17136) : error 021: symbol already defined: "OnPlayerRequestSpawn"

EDIT:
HERES THE MAIN CODE FOR CLASS SELECTION...
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    if (!udb_Exists(PlayerName(playerid)))
    {
        ShowRegisterScreen(playerid);
        return 0;
    }
    if (!PLAYERLIST_authed[playerid]) {
        ShowLoginScreen(playerid);
        return 0;
    }
    if(gTeam[playerid] < 9 && SavedWantedLevel[playerid] != 0)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot use this class as you were wanted last time you left the server.");
        return 0;
    }
    if(gTeam[playerid] < 9 && SavedJailTime[playerid] != 0)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You cannot use this class as you were in jail last time you left the server.");
        return 0;
    }
    if(gTeam[playerid] == TEAM_ARMY && CanUseArmy[playerid] != 1337)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You do not have permission to use this class. ");
        return 0;
    }
    if(gTeam[playerid] == TEAM_CIA && CanUseCIA[playerid] != 1337)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You do not have permission to use this class. ");
        return 0;
    }
    if(GetPlayerSkin(playerid) == 286 && GetPlayerScore(playerid) <= 499)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You do not have permission to use this class. You must gain 500 score before using this class.");
        return 0;
    }
    if(gTeam[playerid] == TEAM_COP && GetPlayerScore(playerid) <= 49)
    {
        SendClientMessage(playerid,COLOR_ERROR,"You do not have permission to use this class. You must gain 50 score before using this class.");
        return 0;
    }
    return 1;
}
Heres What I Added

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerSkin(playerid) == 208)
    {
        new name[24]; GetPlayerName(playerid, name, 24);
        if(strcmp(name, "TheKiller", false)) //Name, do not ignore case
        {
            GameTextForPlayer(playerid, "~r~TheKiller's Exclusive Baught Skin!", 3000, 5);
            return 0; //Stop spawning
        }
    }
}
Reply
#7

You already got one "OnPlayerRequestSpawn", add it in under that..
Reply
#8

pawn Код:
if(GetPlayerSkin(playerid) == 208)
    {
        new name[24]; GetPlayerName(playerid, name, 24);
        if(strcmp(name, "TheKiller", false)) //Name, do not ignore case
        {
            GameTextForPlayer(playerid, "~r~TheKiller's Exclusive Baught Skin!", 3000, 5);
            return 0; //Stop spawning
        }
    }
Add that to your already-existing public.
Reply
#9

C:\Users\Public\Documents\neww\gamemodes\SFCRRPG.p wn(11013) : error 010: invalid function or declaration
pawn Код:
if(GetPlayerSkin(playerid) == 208)
    {
        new name[24]; GetPlayerName(playerid, name, 24);
        if(strcmp(name, "TheKiller", false)) //Name, do not ignore case
        {
            GameTextForPlayer(playerid, "~r~TheKiller's Exclusive Baught Skin!", 3000, 5);
            return 0; //Stop spawning
                    }
    }
}
    return 1;
}
Line 11013
pawn Код:
return 1;
EDIT: NVM
Reply
#10

Try
pawn Код:
if(GetPlayerSkin(playerid) == 208)
    {
        new pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,sizeof(pName));
        if(strcmp(pName,"TheKiller",false) == 0)
        {
            GameTextForPlayer(playerid, "~r~TheKiller's Exclusive Baught Skin!", 3000, 5);
            return 0;
        }
    }
I'm not sure about return 0
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)