Hi I need a full explain please?
#1

I need to know!
I just need to know How to create a teams! I know there alot of tutorials but the problem! Some tutorials sayed EXAMPLE: TEAM_COPS || TEAM_CIV How do we know that FOR TEAM_COPS OR FOR TEAM_CIV? I mean for skins! another example: If we are defines alot of TEAMS and creating a position of them! how to we know that for TEAM_COP OR THAT FOR TEAM_CIV? Can someone explain to me... Im not newbie or something like that I just asking this question to know.. Because as i'm before starting scripter I've choosing another idea because I don't understand TEAMS I've trying my idea SKINS! but as my friends told me TEAMS Is easy way please can some expalin?
Reply
#2

With SetPlayerTeam you can set a team for a player.
In OnPlayerRequestClass now for example you ask if he is in team X, if not you dont let him pick the skin.

In OnPlayerSpawn you ask if he is in team X, if not you spawn him on this coords instead of this.
Reply
#3

a team is nothing else than a collection of player classes, just look at the first parameter of AddPlayerClassEx
Quote:

AddPlayerClassEx(teamid, modelid, Float: spawn_x, Float: spawn_y, Float: spawn_z, Float: z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)

Before Set / GetPlayerTeam were introduced the teams were set in OnPlayerRequestClass by mapping the classids to teams
PHP код:
enum {
    
TEAM_BLUE,
    
TEAM_RED
}
new 
gTeam[MAX_PLAYEERS];
public 
OnPlayerRequestClass(playerid,classid)
{
    switch(
classid) {
        case 
0..2gTeam[playerid] = TEAM_BLUE;
        case 
3..7gTeam[playerid] = TEAM_RED;
    }
    return 
1;

Thats for static teams, dynamic teams like gangs or clans in freeroam modes get the teamid set in "join / accept" commands and at login
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)