16.03.2014, 13:35
If what your asking is how to make a command that only a drug dealer in your server can use, yes that is possible. You can do it by doing this:
At the top of your script you should see a:
Under that text type:
If its not under the #endif, you will get an error code later on. I don't know why but you just do.
Next you need to make the command:
How to set a player as a drugdealer:
//You are going to need something like zcmd to do this, but for the purpose of showing you how to do it, im just going to be showing me doing it to myself using strcmp.
If you get any errors, just ask.
At the top of your script you should see a:
Код:
#endif
Код:
new gTeam[MAX_PLAYERS]; #define GANG_DRUGDEALER 1 //This is where you define the drug dealer
Next you need to make the command:
Код:
if (strcmp("/drugdealer", cmdtext, true, 10) == 0) { if(gTeam[playerid] == GANG_DRUGDEALER) { // Using this command will check if the player is a drug dealer. SendClientMessage(playerid, 0, "You are a drug dealer."); //Type whatever you want to say here. //Type your command here for what you want it to do, like giving the player drugs, or whatever. return 1; } //Closing the if drug dealer command. }
//You are going to need something like zcmd to do this, but for the purpose of showing you how to do it, im just going to be showing me doing it to myself using strcmp.
Код:
if (strcmp("/setdrugdealer", cmdtext, true, 10) == 0) { gTeam[playerid] = GANG_DRUGDEALER; //This sets the players team to drug dealer. SendClientMessage(playerid, 0, "You are now a drug dealer."); //Tells the player he is a drug dealer. }