30.10.2014, 13:55
(
Last edited by Glossy42O; 18/11/2014 at 02:48 PM.
Reason: Didn't like the other title
)
Introduction
Hello! I am stuun i am kinda new at samp forums i wanted to teach you how to make teams for newbies hope you enjoy it. It's simple if not explained tell me i will edit.
EDITED.
1.
First of all make sure you have teams under GameModeInit like that
2.
Make how much teams you want but here ima make only 1. if you wanna make more do the same.
3.
Define your team at the top like that
4.
Go in: public OnPlayerSpawn(playerid)
Put
5.
Now we will use cases this will be in OnPlayerSpawn
Like that:
6.
Now we will use SetPlayerTeam.
Now close bracket like that "}"
FULL CODE:
If you need to add color just put this under SetPlayerTeam
Like that
FULL CODE
Hope you enjoyed my simple tutorial it's for newbies that are new at scripting.
Didn't explain good? Tell me i will edit it.
Hello! I am stuun i am kinda new at samp forums i wanted to teach you how to make teams for newbies hope you enjoy it. It's simple if not explained tell me i will edit.
EDITED.
1.
First of all make sure you have teams under GameModeInit like that
PHP Code:
public OnGameModeInit()
{
SetGameModeText("Blank text");
AddPlayerClass(Here you put skin id ,Put here your coordinates,weapon 1,weapon_ammo,weapon 2,weapon_ammo,weapon 3,weapon_ammo);//That
Make how much teams you want but here ima make only 1. if you wanna make more do the same.
3.
Define your team at the top like that
PHP Code:
#define TEAM_TEST//You don't put test, Put your team name
Go in: public OnPlayerSpawn(playerid)
Put
PHP Code:
switch(GetPlayerTeam(playerid)){
Now we will use cases this will be in OnPlayerSpawn
PHP Code:
case 1 .. 5://1 .. 5 is the ids and ".." is the numbers inside it like 2,3,4 and under it add bracket "{"
PHP Code:
case: 1 .. 5:
{// That is a bracket.
Now we will use SetPlayerTeam.
PHP Code:
SetPlayerTeam(playerid, TEAM_TEST);//SetPlayerTeam is sets the team so the friendly fire will be off. Then put the team name of course so the server will understand that they are team.
FULL CODE:
PHP Code:
case 1 .. 5:
{
SetPlayerTeam(playerid, TEAM_TEST);
}
PHP Code:
SetPlayerColor(playerid, COLOR_YOURCOLOUR);//SetPlayerColor sets his color after that choose the color and make sure it's defined at the top
PHP Code:
#define COLOR_YOURCOLOR
PHP Code:
case: 1 .. 5:
{
SetPlayerTeam(playerid, TEAM_TEST);
SetPlayerColor(playerid, COLOR_YOURCOLOUR);
}
Didn't explain good? Tell me i will edit it.