Score must be 100 To spawn on this Team -
[Cali]ChrOnic_T - 11.06.2014
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
Re : Score must be 100 To spawn on this Team -
Matnix - 11.06.2014
pawn Код:
// yes - 99 beacause if you put 100 he will need 101score.
if(GetPlayerScore(playerid) < 99 )
Re: Score must be 100 To spawn on this Team -
jessejanssen - 11.06.2014
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
Re: Re : Score must be 100 To spawn on this Team -
jessejanssen - 11.06.2014
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
Re : Score must be 100 To spawn on this Team -
Matnix - 11.06.2014
Each killstreaks system I've created was by that way and it's was working so..
Re: Score must be 100 To spawn on this Team -
[Cali]ChrOnic_T - 11.06.2014
IT'S STILL NOT WORKING!
Re: Score must be 100 To spawn on this Team -
Threshold - 11.06.2014
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.