SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 11/07/2018, 10:00 PM   #1
Man43
Huge Clucker
 
Man43's Avatar
 
Join Date: Feb 2017
Posts: 206
Reputation: 0
Default Hi I need a full explain please?

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?
Man43 is offline   Reply With Quote
Old 12/07/2018, 12:55 AM   #2
GangstaSunny.
Huge Clucker
 
GangstaSunny.'s Avatar
 
Join Date: Apr 2010
Location: Hamburg - Germany
Posts: 205
Reputation: 23
Default Re: Hi I need a full explain please?

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.
__________________
Visit my Website
https://gangstasunny.de
GangstaSunny. is offline   Reply With Quote
Old 12/07/2018, 01:03 AM   #3
Nero_3D
High-roller
 
Nero_3D's Avatar
 
Join Date: Jun 2007
Location: Germany
Posts: 3,757
Reputation: 643
Default Re: Hi I need a full explain please?

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 Code:
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
__________________
Nero_3D is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Someone please explain me this? akib Scripting Help 3 12/05/2017 05:57 PM
Someone explain to me NV1D3ATD Scripting Help 1 23/08/2015 02:31 PM
Someone can explain this? dott Scripting Help 3 23/09/2012 10:25 AM
Server is "full" but not full? 4512jth Scripting Help 0 13/02/2012 06:02 PM
who can explain me this? iJumbo Help Archive 6 27/08/2010 10:43 PM


All times are GMT. The time now is 06:44 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.