#1

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

Please i need urgent
Reply
#3

https://sampwiki.blast.hk/wiki/PAWN_tutorial
Reply
#4

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

Quote:
Originally Posted by Logitech90
View Post
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;
}
}
Reply
#6

pawn Code:
gTeam[playerid] = MEDIC_RED;
MEDIC_RED is a class or a rank of the selected class?It's bit confusing...
Reply
#7

its a team.i wanna change the team from TEAM_RED to MEDIC_RED
Reply
#8

Quote:
Originally Posted by §с†¶e®РµРe
View Post
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?
Reply
#9

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

Cause I am on phone posted this mistake
Reply
#11

Quote:
Originally Posted by §с†¶e®РµРe
View Post
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.
Reply
#12

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

Quote:
Originally Posted by §с†¶e®РµРe
View Post
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?
Reply
#14

Yes..thanks +rep will be done as soon I come on computer
Reply
#15

No problem.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)