Author Topic: hey! plz help me!  (Read 2466 times)

0 Members and 1 Guest are viewing this topic.

Offline Mansoor ali

  • Street Thug
  • *
  • Posts: 25
  • I'm Back my old account Works! :D
    • View Profile
hey! plz help me!
« on: April 18, 2012, 09:17:20 am »
hi guyz i need help i want a commands which cmd without cop fbi army swat skins no one can use so plz help me if it is posible.?  :-\

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: hey! plz help me!
« Reply #1 on: April 18, 2012, 09:56:01 am »
Is possible, but you need to add a variable.

Put this in the top of script:
Code: [Select]
new Cop[MAX_PLAYERS];
new Criminal[MAX_PLAYERS];

Now, need to set the variable to playerid to can see if is Cop or not:
(From your last topic "A little help plz")
Code: [Select]
if(classid == 1 || classid == 2 || classid == 3 || classid == 4) {
   SendClientMessage(playerid,COLOR_YELLOW,"*** You have spawned as a law enforcement person.");
   Cop[playerid] = 1;
}
if(classid == 11) {
   SendClientMessage(playerid,COLOR_YELLOW,"*** You have spawned as a criminal.");
   Criminal[playerid] = 1;
}

And now, to remove the status (Cop/Criminal) of player when he die cuse:

Add this at OnPlayerDeath:
Code: [Select]
Cop[playerid] = 0;
Criminal[playerid] = 0;

Need to reset the variables and when the player left the server.

Put this at OnPlayerDisconnect:
Code: [Select]
Cop[playerid] = 0;
Criminal[playerid] = 0;


And if you want to make a command just for Cops or just for Criminals you will need the variable.

Something like this:
Code: [Select]
//This cmd is just for cops
else if(strcmp(cmd,"heal",true) == 0) {
if(Cop[playerid] == 1) {
  SendClientMessage(playerid,COLOR_YELLOW,"Cop, you was healed");
  SetPlayerHealth(playerid,100.0);
} else {
  SendClientMessage(playerid,COLOR_YELLOW,"Or you aren't spawned, or you aren't cop !");
}
return 1;
}


//This cmd is just for criminals
else if(strcmp(cmd, "armour", true) == 0) {
if(Criminal[playerid] == 1) {
   SendClientMessage(playerid,COLOR_YELLOW,"Criminal, you get armour");
   SetPlayerArmour(playerid,100.0);
} else {
   SendClientMessage(playerid,COLOR_YELLOW,"Or you aren't spawned, or you aren't criminal !");
}
return 1;
}

« Last Edit: April 18, 2012, 10:04:13 am by sseebbyy »

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline Mansoor ali

  • Street Thug
  • *
  • Posts: 25
  • I'm Back my old account Works! :D
    • View Profile
Re: hey! plz help me!
« Reply #2 on: April 18, 2012, 10:16:44 am »
Nice sseebbyy!  :o
you are the pro scripter thankx for help  ;)
i want to your friend.
now with your help i am going to release my script: Cops vs Criminals v1.0
 ::)