Locking a skin to certain players
#1

Hey,

I've made both the SWAT and ARMY teams and I'm wondering how I could lock the team only to certain players. I have them both in my MySQL database and I just need to add the lock to the skins,

SWAT:

pawn Код:
pInfo[playerid][pSwat] // pArmy for army
Taken from OnPlayerRequestClass,

pawn Код:
case 9 :
            {
                SetPlayerInterior(playerid, 0);
                GameTextForPlayer( playerid, "~b~S.W.A.T", 3000, 4 );
                gTeam[ playerid ] = TEAM_SWAT;
                /////////////////////////[REMEMBER TO CHANGE]///////////////////////////////
                SetPlayerPos(playerid, 1996.9724,-1969.3861,16.6941); // REMEMBER TO CHANGE
                SetPlayerFacingAngle(playerid, 357.1197); // REMEMBER TO CHANGE
                SetPlayerCameraPos(playerid, 1997.2798,-1964.0056,16.6941); // REMEMBER TO CHANGE
                SetPlayerCameraLookAt(playerid, 1996.9724,-1969.3861,16.6941); // REMEMBER TO CHANGE
                ApplyAnimation( playerid, "DEALER", "DEALER_IDLE", 4.0, 1, 0, 0, 0, 0, 1 );
                SetPlayerColor(playerid,TEAM_COLOR_SWAT);

            }
^^I'm not sure if you need onplayerrequestclass or requestspawn to lock the skin

If a player that is below pSwat level 1, a message would be sent to them saying that the skin is locked.#

Thanks!
Reply
#2

******, that's not what he wants, he just wants to lock it(I think). You can do this by adding something as easy as in this in the request-spawn callback

pawn Код:
if(pInfo[playerid][pSwat] == 0)
{
    SendClientMessage(playerid, -1, "You are not authorized to use this skin.");
    return 0;
}
Reply
#3

Quote:
Originally Posted by Abagail
Посмотреть сообщение
******, that's not what he wants, he just wants to lock it(I think). You can do this by adding something as easy as in this in the request-spawn callback

pawn Код:
if(pInfo[playerid][pSwat] == 0)
{
    SendClientMessage(playerid, -1, "You are not authorized to use this skin.");
    return 0;
}
EDIT: I'll try that out. Thanks


Quote:
Originally Posted by ******
Посмотреть сообщение
Yes, you CAN do that, but IMHO it is far better to remove the skin entirely from class selection so players who can't use a skin don't even get to see the skin.
I would rather keep the skin for everyone to see, just not for everyone to use. But I'm probably going to try out y_classes anyway.

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)