Define Teams?
#1

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 ?
Reply
#2

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

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

Replace

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

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

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

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.
Reply
#7

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

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;
}
Reply
#9

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?
Reply
#10

Add that OnPlayerSpawn callback, Give a try lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)