Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: Mansoor ali on April 18, 2012, 09:17:20 am

Title: hey! plz help me!
Post by: Mansoor ali 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.?  :-\
Title: Re: hey! plz help me!
Post by: sseebbyy 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;
}

Title: Re: hey! plz help me!
Post by: Mansoor ali 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
 ::)