Need Help with Teams(check Score)
#1

this is the code :
Code:
if (strcmp("/joinstars", cmdtext, true, 10) == 0)
	{
	    SetPlayerPos(playerid, -2239.9321,-1747.2985,480.8629);
	    SetPlayerSkin(playerid, 287);
	    gTeam[playerid] = TEAM_ARMY;
	    ResetPlayerWeapons(playerid);
	    GivePlayerWeapon(playerid, 24, 100);
	    GivePlayerWeapon(playerid, 26, 100);
	    GivePlayerWeapon(playerid, 31, 500);
	    SetPlayerColor(playerid,0x0000FFAA);
	    SendClientMessage(playerid,0x0000FFAA," Welcome to the STARS QG!");
	    return 1;
	}
i want if the player do /joinstars , the system check score, if he has 800 in score , he can use this command
if not he can't do it

Please Help
Reply
#2

Code:
if (strcmp("/joinstars", cmdtext, true, 10) == 0)
{
            if(GetPlayerScore(playerid) >= 800)
            {
	         SetPlayerPos(playerid, -2239.9321,-1747.2985,480.8629);
	         SetPlayerSkin(playerid, 287);
	         gTeam[playerid] = TEAM_ARMY;
	         ResetPlayerWeapons(playerid);
	         GivePlayerWeapon(playerid, 24, 100);
	         GivePlayerWeapon(playerid, 26, 100);
	         GivePlayerWeapon(playerid, 31, 500);
	         SetPlayerColor(playerid,0x0000FFAA);
	         SendClientMessage(playerid,0x0000FFAA," Welcome to the STARS QG!");
            }
            else
            {
                SendClientMessage(playerid,0x0000FFAA,"You must have a score of at least 800 to enter!");
             }
	    return 1;
}
Reply
#3

Untested.

pawn Code:
if (strcmp("/joinstars", cmdtext, true, 10) == 0)
    {
        if(GetPlayerScore(playerid) >= 800) return SendClientMessage(playerid, 0xFF0000FF, "You must have over 800 score to use this command.");
        SetPlayerPos(playerid, -2239.9321,-1747.2985,480.8629);
        SetPlayerSkin(playerid, 287);
        gTeam[playerid] = TEAM_ARMY;
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 24, 100);
        GivePlayerWeapon(playerid, 26, 100);
        GivePlayerWeapon(playerid, 31, 500);
        SetPlayerColor(playerid,0x0000FFAA);
        SendClientMessage(playerid,0x0000FFAA," Welcome to the STARS QG!");
        return 1;
    }
Edit: I was late.
Reply
#4

thanks a lot for your repplys ! i gonna test it now
Reply
#5

Not Working + 1 warning :
Code:
C:\DOCUME~1\mrich\Bureau\tyr\LOGINA~1\GAMEMO~1\MCIREL~1.PWN(510) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
EDITE:

DUDE, brett7's Code is 100% working thanx man !
Reply
#6

Whos code are you using mine or Davz*|*Criss? Anyway its just a warning not an error.
Reply
#7

Try changing:

pawn Code:
if(!GetPlayerScore(playerid) >= 800)
To

pawn Code:
if(GetPlayerScore(playerid) >= 800)
Sorry for the one warning i told you i untested.
Reply
#8

No Problem Davz i hope you come to helping me , thank you all it is resolved
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)