SA-MP Forums Archive
HOW TO MAKE COMMANDS FOR DIFFERENT CLASSES?? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HOW TO MAKE COMMANDS FOR DIFFERENT CLASSES?? (/showthread.php?tid=80926)



HOW TO MAKE COMMANDS FOR DIFFERENT CLASSES?? - Pawno_Master - 07.06.2009

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


Re: HOW TO MAKE COMMANDS FOR DIFFERENT CLASSES?? - miokie - 07.06.2009

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.


Re: HOW TO MAKE COMMANDS FOR DIFFERENT CLASSES?? - lol2112 - 07.06.2009

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 "!="!


Re: HOW TO MAKE COMMANDS FOR DIFFERENT CLASSES?? - Pawno_Master - 07.06.2009

Ok,, how do i make the jobs than?


Re: HOW TO MAKE COMMANDS FOR DIFFERENT CLASSES?? - Luka P. - 07.06.2009

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 ==.


Re: HOW TO MAKE COMMANDS FOR DIFFERENT CLASSES?? - lol2112 - 07.06.2009

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"...


Re: HOW TO MAKE COMMANDS FOR DIFFERENT CLASSES?? - Luka P. - 07.06.2009

Yeah,sorry,my bad.


Re: HOW TO MAKE COMMANDS FOR DIFFERENT CLASSES?? - lol2112 - 07.06.2009

lol np.


Re: HOW TO MAKE COMMANDS FOR DIFFERENT CLASSES?? - miokie - 07.06.2009

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


Re: HOW TO MAKE COMMANDS FOR DIFFERENT CLASSES?? - lol2112 - 07.06.2009

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