Score must be 100 To spawn on this Team
#1

How to make it so. You must have 100 score to spawn as this team


pawn Код:
public OnPlayerRequestSpawn(playerid)
{  
   //==== DONT MIND THISS ==================
      new  name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    if(gTeam[playerid] == TEAM_Cali) {
        if (strfind(name, "[Cali]", true) == 0) {
            return 1;
        }
        else {
            GameTextForPlayer(playerid, "~r~You're not in (Cali)!", 3000, 5);
            ForceClassSelection(playerid);
            return 0;
        }
//==============================================

//===== this is the problem vvvvv ==============

    if(gTeam[playerid] == TEAM_SWAT)
    {
        if(GetPlayerScore(playerid) > 100)
        {
            GameTextForPlayer(playerid,"NEED 100 SCORE",3000,3);
            SendClientMessage(playerid,-1,"You need atleast 100 score to play on this team.");
            return 0;
        }
    }
    return 1;
 }
   return 1;
}
I really need this fixed cause im releasing my server 1.3 version soon
Reply
#2

pawn Код:
// yes - 99 beacause if you put 100 he will need 101score.
 if(GetPlayerScore(playerid) < 99 )
Reply
#3

Quote:
Originally Posted by [Cali]ChrOnic_T
Посмотреть сообщение
How to make it so. You must have 100 score to spawn as this team


pawn Код:
public OnPlayerRequestSpawn(playerid)
{  
   //==== DONT MIND THISS ==================
      new  name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    if(gTeam[playerid] == TEAM_Cali) {
        if (strfind(name, "[Cali]", true) == 0) {
            return 1;
        }
        else {
            GameTextForPlayer(playerid, "~r~You're not in (Cali)!", 3000, 5);
            ForceClassSelection(playerid);
            return 0;
        }
//==============================================

//===== this is the problem vvvvv ==============

    if(gTeam[playerid] == TEAM_SWAT)
    {
        if(GetPlayerScore(playerid) > 100)
        {
            GameTextForPlayer(playerid,"NEED 100 SCORE",3000,3);
            SendClientMessage(playerid,-1,"You need atleast 100 score to play on this team.");
            return 0;
        }
    }
    return 1;
 }
   return 1;
}
I really need this fixed cause im releasing my server 1.3 version soon
pawn Код:
public OnPlayerRequestSpawn(playerid)
{  
   //==== DONT MIND THISS ==================
      new  name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    if(gTeam[playerid] == TEAM_Cali) {
        if (strfind(name, "[Cali]", true) == 0) {
            return 1;
        }
        else {
            GameTextForPlayer(playerid, "~r~You're not in (Cali)!", 3000, 5);
            ForceClassSelection(playerid);
            return 0;
        }
//==============================================

//===== this is the problem vvvvv ==============

    if(gTeam[playerid] == TEAM_SWAT)
    {
        if(GetPlayerScore(playerid) < 100)
        {
            GameTextForPlayer(playerid,"NEED 100 SCORE",3000,3);
            SendClientMessage(playerid,-1,"You need atleast 100 score to play on this team.");
            ForceClassSelection(playerid);
            return 0;
        }
    }
    return 1;
 }
   return 1;
}
All I changed was > to < and added 'ForceClassSelection', you checked/returned the message if the player was at least score 100, now it's doing so if the player is lower then score 100.

Best regards,
Jesse
Reply
#4

Quote:
Originally Posted by Matnix
Посмотреть сообщение
pawn Код:
// yes - 99 beacause if you put 100 he will need 101score.
 if(GetPlayerScore(playerid) < 99 )
I editted my post and now the post time also updated making it set under your post. Anyhow, you're wrong. < says is smaller then, < 99 means is smaller then 99 (98, 97, 96.....), < 100 means is smaller then 100, so that would also be score 99. If he would've used <= you would have been right because that means is smaller then or is equal to.

Best regards,
Jesse
Reply
#5

Each killstreaks system I've created was by that way and it's was working so..
Reply
#6

IT'S STILL NOT WORKING!
Reply
#7

It's < 100, not 99.

Just a shortened and neater version:
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(gTeam[playerid] == Team_Cali)
    {
        if(strfind(name, "[Cali]", true) != 0) //This will only work if the player has [Cali] at the BEGINNING of their name.
        {
            GameTextForPlayer(playerid, "~r~You're not in (Cali)!", 3000, 5);
            ForceClassSelection(playerid);
            return 0;
        }
    }
    else if(gTeam[playerid] == TEAM_SWAT)
    {
        if(GetPlayerScore(playerid) < 100)
        {
            GameTextForPlayer(playerid, "NEED 100 SCORE", 3000, 3);
            SendClientMessage(playerid, -1, "You need atleast 100 score to play on this team.");
            ForceClassSelection(playerid);
            return 0;
        }
    }
    return 1;
}
EDIT: If this doesn't work, then gTeam[playerid] isn't TEAM_SWAT.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)