Restrict from spawning as team without specific score.
#1

I got this below system from someone, sadly, it fails to work.

It's quite odd, because when i don't have the required score, i click on the team, and it says i need 2000 score "Client message" but i can still become the team. But when i spawn, I'm CJ falling into the ground at that farm.

Now, if i had the required score, i can spawn normally at the team spawn. Only problem is, it does not restrict anyone below 4000 score from spawning as this team without the required score.

pawn Code:
case 6:
                {
                    if(GetPlayerScore(playerid) < 4000)
                    {
                    SendClientMessage(playerid, C_RED, "You need 4000 score to choose US Army.");
                    ShowPlayerDialog(playerid, Team_Dialog, DIALOG_STYLE_LIST, "{33AA33}Team Selection", "{15FF00}England\n{FF0000}Soviet Union\n{FFFF00}Taliban Cell\n{0000BB}United States\n{A86EFC}Australian Armada\n{FF9900}European Alliance\n{AFAFAF}US Army", "Choose", "");
                    }
                    else
                    {
                       gTeam[playerid] = T_SPECIAL;
                       SetPlayerColor(playerid, C_GREY);
                       GameTextForPlayer(playerid, "~r~US Army", 3000, 3);
                     //ShowPlayerDialog(playerid, Skin_Dialog, DIALOG_STYLE_LIST, "Select a Skin", "", "Choose", "");
                       SetSpawnInfo(playerid, 0, 121, -1217.3820,1493.2750,21.6103,280.8538, 0, 0, 0, 0, 0, 0);

                    }
                }

            }
            ShowPlayerDialog(playerid, Class_Dialog, DIALOG_STYLE_LIST, "{15FF00}Class Selection", "Assault\nMedic {FF0000}(Score: 50)\nSniper {FF0000}(Score: 300)\nAnti-Tank {FF0000}(Score: 500)\nSpy {FF0000}(Score: 2500)\nPilot {FF0000}(Score: 6500)\nEngineer {FF0000}(Score: 1000)\nSpecial Operations {FF0000}(Score: 10000)", "Choose", "");
        }
Reply
#2

That's apart of a Dialog btw ^^ so it's still not different.

Any smarties able to figure this one out? I'd imagine it's not as hard.
Reply
#3

I see no problem
Reply
#4

Nevermind.. I fixed it by adding "Return" like this
pawn Code:
return ShowPlayerDialog(playerid, Team_Dialog, DIALOG_STYLE_LIST, "{33AA33}Team Selection", "{15FF00}England\n{FF0000}Soviet Union\n{FFFF00}Taliban Cell\n{0000BB}United States\n{A86EFC}Australian Armada\n{FF9900}European Alliance\n{AFAFAF}US Army", "Choose", "");

Oh mai lawd
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)