Restricting a Class
#1

Hi, I'm trying to restrict a class so you can only use it if your admin level 100.

This is my code so far:

pawn Код:
else if(GetPlayerSkin(playerid) == 230)
    {
        if(PlayerInfo[playerid][pAdmin] < 100)
        {
            SendClientMessage(playerid, COLOR_GREY,"This is a restricted class!");
            return 1;
        }
        GameTextForPlayer(playerid, "~y~OG Gangsta's", 2000, 3);
        SetPlayerPos(playerid, 1129.0776, -1488.1957, 22.7690);
        SetPlayerFacingAngle(playerid, 0.7288);
        SetPlayerCameraPos(playerid, 1129.1257,-1476.7831,22.7690);
        SetPlayerCameraLookAt(playerid, 1129.0983, -1485.8500, 22.7690);
        SetPlayerVirtualWorld(playerid, 1);
    }
    return 1;
}
I want the player to be able to see the class but when the click 'Spawn' it will send the message.

I also need to do this relating to the FBI and Military w/ If(PlayerInfo[playerid][pKills] >= 200) for example.

Thanks.
Reply
#2

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if( GetPlayerSkin( playerid ) == 230 && PlayerInfo[playerid][pAdmin] < 100 )
    {
        SendClientMessage(playerid, COLOR_GREY, "This is a restricted class!" );
        return 0;
    }
    return 1;
}

public OnPlayerSpawn( playerid )
{
    if( GetPlayerSkin( playerid ) == 230 )
    {
        GameTextForPlayer(playerid, "~y~OG Gangsta's", 2000, 3);
        SetPlayerPos(playerid, 1129.0776, -1488.1957, 22.7690);
        SetPlayerFacingAngle(playerid, 0.7288);
        SetPlayerCameraPos(playerid, 1129.1257,-1476.7831,22.7690);
        SetPlayerCameraLookAt(playerid, 1129.0983, -1485.8500, 22.7690);
        SetPlayerVirtualWorld(playerid, 1);
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by FalconX
Посмотреть сообщение
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if( GetPlayerSkin( playerid ) == 230 && PlayerInfo[playerid][pAdmin] < 100 )
    {
        SendClientMessage(playerid, COLOR_GREY, "This is a restricted class!" );
        return 0;
    }
    return 1;
}

public OnPlayerSpawn( playerid )
{
    if( GetPlayerSkin( playerid ) == 230 )
    {
        GameTextForPlayer(playerid, "~y~OG Gangsta's", 2000, 3);
        SetPlayerPos(playerid, 1129.0776, -1488.1957, 22.7690);
        SetPlayerFacingAngle(playerid, 0.7288);
        SetPlayerCameraPos(playerid, 1129.1257,-1476.7831,22.7690);
        SetPlayerCameraLookAt(playerid, 1129.0983, -1485.8500, 22.7690);
        SetPlayerVirtualWorld(playerid, 1);
    }
    return 1;
}
Thank you so much, works perfectly.

+Rep'd.

Edit: I see you script for $$. I will be in touch soon.
Reply
#4

Quote:
Originally Posted by Melon
Посмотреть сообщение
Thank you so much, works perfectly.

+Rep'd.

Edit: I see you script for $$. I will be in touch soon.
No problem mate, and yes I script for $$
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)