Teams -
§с†¶e®РµРe - 01.01.2012
Hello people,
First a very Happy New Year.
I am making a TDM and i have got a medic class.I don't want the medic class to be availible on spawn i want like on spawn player can select TEAM_RED or TEAM_BLUE.(I have that code).After that i view hem a menu what to become including many things like Sniper,Medic etc etc.
ow can i do it that if player selects medic then if he is in TEAM_BLUE his team gets changed to MEDIC_BLUE and if he is in TEAM_RED his team gets changed to MEDIC_RED.
Thank You!!
Re: Teams -
§с†¶e®РµРe - 01.01.2012
Please i need urgent
Re: Teams -
Bogdan1992 - 01.01.2012
https://sampwiki.blast.hk/wiki/PAWN_tutorial
Re: Teams -
Face9000 - 01.01.2012
Ok then,you have already TEAM_RED and TEAM_BLUE?
We suppose that the player choose TEAM_BLUE,so medic is a RANK (that's how i call it to avoid confusion in the server),you can make an IF and set the MEDIC_RED or MEDIC_BLUE.Example:
pawn Code:
if(gTeam[playerid] == TEAM_BLUE) {
SetPlayerColor(playerid,COLOR_BLUE);
SendClientMessage(playerid,COLOR_BLUE,"You are a medic of your blue team now!");
{
return 0;
}
}
else if(gTeam[playerid] == TEAM_GERMANY)
{
//Blabla
Something like this?
Re: Teams -
§с†¶e®РµРe - 01.01.2012
Quote:
Originally Posted by Logitech90
Ok then,you have already TEAM_RED and TEAM_BLUE?
We suppose that the player choose TEAM_BLUE,so medic is a RANK (that's how i call it to avoid confusion in the server),you can make an IF and set the MEDIC_RED or MEDIC_BLUE.Example:
pawn Code:
if(gTeam[playerid] == TEAM_BLUE) { SetPlayerColor(playerid,COLOR_BLUE); SendClientMessage(playerid,COLOR_BLUE,"You are a medic of your blue team now!"); { return 0; } } else if(gTeam[playerid] == TEAM_GERMANY) { //Blabla
Something like this?
|
can i do
pawn Code:
if(gTeam[playerid] == TEAM_BLUE) {
SetPlayerColor(playerid,COLOR_BLUE);
SendClientMessage(playerid,COLOR_BLUE,"You are a medic of your blue team now!");
gTeam[playerid] = MEDIC_BLUE;
{
return 0;
}
}
else if(gTeam[playerid] == TEAM_RED) {
SetPlayerColor(playerid,COLOR_RED);
SendClientMessage(playerid,COLOR_RED,"You are a medic of your red team now!");
gTeam[playerid] = MEDIC_RED;
{
return 1;
}
}
Re: Teams -
Face9000 - 01.01.2012
pawn Code:
gTeam[playerid] = MEDIC_RED;
MEDIC_RED is a class or a rank of the selected class?It's bit confusing...
Re: Teams -
§с†¶e®РµРe - 01.01.2012
its a team.i wanna change the team from TEAM_RED to MEDIC_RED
Re: Teams -
Face9000 - 01.01.2012
Quote:
Originally Posted by §с†¶e®РµРe
its a team.i wanna change the team...
|
So,let's take few example:
You have TEAM_BLUE AND MEDIC_BLUE,both are teams?
You can select ONLY 1 team when spawn,i assume you intend a RANK.
Ex: TEAM_BLUE has medic,mechianic etc...right?
Re: Teams -
§с†¶e®РµРe - 01.01.2012
listen.
a player spawns as TEAM_BLUE for ex. then he gets a menu with many options like soldier.medic etc.if he select medic his team changes from team_blue to medic_blue
Re: Teams -
§с†¶e®РµРe - 01.01.2012
Cause I am on phone posted this mistake
Re: Teams -
Face9000 - 01.01.2012
Quote:
Originally Posted by §с†¶e®РµРe
listen.
a player spawns as TEAM_BLUE for ex. then he gets a menu with many options like soldier.medic etc.if he select medic his team changes from team_blue to medic_blue
|
LOL is what i said! I call it "ranks" so i can't do confusion.
Ok then..You have already MEDIC_BLUE/MEDIC_RED code?
You can use a dialog when you spawn for allow the selecting ranks.Ex:
pawn Code:
if(dialogid == YOUR_DIALOG_ID)
{
if(response)
{
If(listitem == 0) // MEDIC_BLUE
{
//Your code for the MEDIC_BLUE rank,ex ability to heal players etc.
}
I suggest you to follow my example,make a dialog_list for every rank and use ShowPlayerDialog on OnPlayerSpawn.
Re: Teams -
§с†¶e®РµРe - 01.01.2012
U r not understanding I have already done this.how do I switch the players team.its not a rank its a different team.
If u can't understand then answer this and i'll just modify the code.tel me how can I change players team from blue to red after spawn with if.
So if player is in red change to blue and if in blue change to red
Re: Teams -
Face9000 - 01.01.2012
Quote:
Originally Posted by §с†¶e®РµРe
U r not understanding I have already done this.how do I switch the players team.its not a rank its a different team.
If u can't understand then answer this and i'll just modify the code.tel me how can I change players team from blue to red after spawn with if.
So if player is in red change to blue and if in blue change to red
|
Than you can use
pawn Code:
if(gTeam[playerid] == TEAM_BLUE)
{
gTeam[playerid] = MEDIC_BLUE;
SetPlayerColor(playerid, COLOR_BLUE);
GameTextForPlayer(playerid, "~w~You have been switched to team~n~~b~Blue",2500,6);
}
This?
Re: Teams -
§с†¶e®РµРe - 01.01.2012
Yes..thanks +rep will be done as soon I come on computer
Re: Teams -
Face9000 - 01.01.2012
No problem.