SA-MP Forums Archive
Define Teams? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Define Teams? (/showthread.php?tid=280356)



Define Teams? - ServerScripter - 31.08.2011

Hi , i have this

AddPlayerClass(285,-379.6754,911.4002,9.4913,81.5043,0,0,0,0,0,0);//STARS/////

i want the system know that PlayerClash is On Team 2(whene Player Spawn with this skin:285, for an example i don't want him use a command, so , it says to him : you are not in team 3) , so, i want the system know that This Playerclass(285) is on team 2 how to do that ?


Re : Define Teams? - Naruto_Emilio - 31.08.2011

pawn Код:
//In the top
#define TEAM_ONE 1
new gTeam[MAX_PLAYERS];
//=====================//
public OnPlayerSpawn(playerid)
{
if(gTeam[playerid] == TEAM_ONE)
{
//Your Function
}
return 1;
}



Re: Define Teams? - ServerScripter - 31.08.2011

I don't understand, how this code can know the Skin 285?


Re: Define Teams? - Pinguinn - 31.08.2011

Replace

pawn Код:
if(gTeam[playerid] == TEAM_ONE)
with

pawn Код:
if(gTeam[playerid] == TEAM_ONE && GetPlayerSkin(playerid) == 285)



Re: Define Teams? - ServerScripter - 31.08.2011

Thank you a lot ! but what can i add in //your Fonction ?


Re: Define Teams? - Shetch - 31.08.2011

Quote:
Originally Posted by ServerScripter
Посмотреть сообщение
Thank you a lot ! but what can i add in //your Fonction ?
Add something that will happen when player spawns in team one with 285 skin.


Re: Define Teams? - ServerScripter - 31.08.2011

ok and how to check if player have specifed Score to join it , like : he must have 560score or then to join it..


Re: Define Teams? - Vince - 31.08.2011

https://sampwiki.blast.hk/wiki/AddPlayerClassEx

Fixed. To check score:
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(GetPlayerTeam(playerid) == /* whatever teamid */ && GetPlayerScore < 560)
    {
        GameTextForPlayer(playerid, "Needs 560 Score!", 3000, 5);
        return 0;
    }
    return 1;
}



Re: Define Teams? - ServerScripter - 31.08.2011

whene i use that :
pawn Код:
if(gTeam[playerid] == TEAM_ONE && GetPlayerSkin(playerid) == 285)
i can't spawn with the Class 285... who can help me to fix that?


Re: Define Teams? - Davz*|*Criss - 31.08.2011

Add that OnPlayerSpawn callback, Give a try lol.