HOW TO MAKE COMMANDS FOR DIFFERENT CLASSES??
#1

how can i make commands for different classes like, /heal id for medic and /cuff id for cops ?? :S
Reply
#2

You name is Pawno Master... You should Know how to do it if your the Realll Master!

But, Use gTeam and in your command Check if the player is the right gTeam and if they aren't don't let them use the command.

Example:At the top of a Police command...
pawn Код:
if(gTeam[playerid] == TEAM_COPS)
{
  //Do Stuff Here
}
else
{
  SendClientMessage(playerid,COLOR_RED,"You are not a Cop!");
}
Note: This is a example, So it may not work with your script.
Reply
#3

I think you'll want to take a look at this Pawn tutorial. In particular look at the section on making a team deathmatch cos it tells you how to make teams.

And Miokie, you used "==" but you meant "!="!
Reply
#4

Ok,, how do i make the jobs than?
Reply
#5

Quote:
Originally Posted by lol2112
I think you'll want to take a look at this Pawn tutorial. In particular look at the section on making a team deathmatch cos it tells you how to make teams.

And Miokie, you used "==" but you meant "!="!
Miokie`s code is correct. He used return so it must be ==.
Reply
#6

Quote:
Originally Posted by Pawno_Master
Ok,, how do i make the jobs than?
I think it'd be best if you used this. Both the questions you've asked are covered in lots of detail in this forum or on SA-MP Wiki.

And Luka his code says: if the player is a cop, return "you are not a cop"...
Reply
#7

Yeah,sorry,my bad.
Reply
#8

lol np.
Reply
#9

Quote:
Originally Posted by lol2112
lol np.
Ahh My bad on the gTeam checking, Fixed it Now.
Reply
#10

Do the SetPlayerTeam(playerid, TEAM) and GetPlayerTeam(playerid) functions work? If yeah, then why does hardly anyone use them?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)