Help with locking a skin
#1

Hey,

I'm trying to lock the SWAT and Army skin to people with SWAT/Army level 1 or above (saved in the MySQL)

pawn Код:
if ( gTeam[ playerid ] == TEAM_SWAT )
    {
        if(pInfo[playerid][pSwat] < 1 )
        {
            SendClientMessage(playerid, RED, "You are not authorised to use this skin");
            SetPlayerHealth(playerid, 0);
        }

    }
    if ( gTeam[ playerid ] == TEAM_ARMY )
    {
        if(pInfo[playerid][pArmy] < 1 )
        {
            SendClientMessage(playerid, RED, "You are not authorised to use this skin");
            SetPlayerHealth(playerid, 0);
        }

    }
That is under OnPlayerRequestSpawn, I added the SetPlayerHealth because it would just send a message once you've spawned.

I'm trying to set it so that if you don't have a SWAT/Army level it wont let you spawn when you click the 'Spawn' button when your choosing a player skin/class, it will send you a message saying you can't use it and it wont let you spawn. (Wont spawn the player) How could I add this?

Thanks
Reply
#2

pawn Код:
if ( gTeam[ playerid ] == TEAM_SWAT )
    {
        if(pInfo[playerid][pSwat] < 1 )
        {
            SendClientMessage(playerid, RED, "You are not authorised to use this skin");
            return 0;
        }

    }
    if ( gTeam[ playerid ] == TEAM_ARMY )
    {
        if(pInfo[playerid][pArmy] < 1 )
        {
            SendClientMessage(playerid, RED, "You are not authorised to use this skin");
            return 0;
        }

    }
Try now.

Also if you have problems with something you don't need to open new topic just take a look at the WIKI: https://sampwiki.blast.hk/wiki/OnPlayerRequestSpawn see it says there that if you return 0; that the player will not spawn.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)