Problem: Only join team with level 2 or higher
#1

Heey guys,

I have made 3 teams in my gamemode now,

1. Terrorists
2. SWAT
3. Donator

But you can join donator with level 0

I want that you can only use donator team with level 2 or higher!

My script:

PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    
Update3DTextLabelText(RankLabel[playerid], 0xFFFFFFFF" ");
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridx,y,z);
    switch(
classid)
    {
        case 
0:
        {
            
// TERRORISTS //
            
SetPlayerFacingAngle(playerid,280.0);
            
SetPlayerPos(playerid, -382.5999,2206.6169,42.4236);
            
SetPlayerCameraPos(playerid, -379.5999,2206.6169,42.4236);
            
SetPlayerCameraLookAt(playerid, -382.5999,2206.6169,42.4236CAMERA_MOVE);
            
TextDrawHideForPlayer(playeridA);
            
TextDrawHideForPlayer(playeridS);
            
TextDrawHideForPlayer(playeridU);
            
TextDrawHideForPlayer(playeridA2);
            
TextDrawShowForPlayer(playeridE);
            
gTeam[playerid] = TEAM_TERRORISTS;
            
SetPlayerTeam(playerid0);
            
SetPlayerSkin(playerid124);
            
SetPlayerColor(playeridTEAM_TERRORISTS_COLOR);
            
Update3DTextLabelText(RankLabel[playerid], 0xFFFFFFFF" ");
        }
        case 
1:
        {
            
// SWAT //
            
SetPlayerFacingAngle(playerid,180.0);
            
SetPlayerPos(playerid212.7791,1919.7570,17.6406);
            
SetPlayerCameraPos(playerid212.7791,1916.7570,17.6406);
            
SetPlayerCameraLookAt(playerid212.7791,1919.7570,17.6406CAMERA_MOVE);
            
TextDrawShowForPlayer(playeridA);
            
TextDrawHideForPlayer(playeridS);
            
TextDrawHideForPlayer(playeridU);
            
TextDrawHideForPlayer(playeridA2);
            
TextDrawHideForPlayer(playeridE);
            
SetPlayerTeam(playerid1);
            
SetPlayerSkin(playerid285);
            
gTeam[playerid] = TEAM_SWAT;
            
SetPlayerColor(playeridTEAM_SWAT_COLOR);
            
Update3DTextLabelText(RankLabel[playerid], 0xFFFFFFFF" ");
        }
        case 
2:
        {
            
// DONATOR //
            
SetPlayerFacingAngle(playerid250.0);
            
SetPlayerPos(playerid219.7300,1822.7803,7.5293);
            
SetPlayerCameraPos(playerid226.8338,1823.0217,7.4141);
            
SetPlayerCameraLookAt(playerid100.8338,1823.0217,7.4141CAMERA_MOVE);
            
TextDrawShowForPlayer(playeridS);
            
TextDrawHideForPlayer(playeridA);
            
TextDrawHideForPlayer(playeridU);
            
TextDrawHideForPlayer(playeridA2);
            
TextDrawHideForPlayer(playeridE);
            
SetPlayerSkin(playerid123);
            
SetPlayerTeam(playerid2);
            
gTeam[playerid] = TEAM_DONATOR;
            
SetPlayerColor(playeridTEAM_DONATOR_COLOR);
            
Update3DTextLabelText(RankLabel[playerid], 0xFFFFFFFF" ");
        }
    }
    return 
1;

Please Help
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)