Hello there,
Yeah it's quite simple. Whenever you make a player enter the
DM Minigame, just assign a value to the player, e.g
- On top of your script:
Define a global variable (like, Minigun, etc) for each player, such as
Quote:
new Minigun[MAX_PLAYERS];
|
Reason: This will declare a global variable, which can be used for each player id.
- Setting value to 0 in OnPlayerConnect:
- Using it in the script:
When you are teleporting a player to the DM Minigame: (means, when you are using the SetPlayerPos function to teleport a player)
When you are teleporting back a player from the DM Minigame: (means do this in your /leave command)
- How to prevent the players from using cmds in the DM Minigame
This can be done by two methods:
1. If you're using OnPlayerCommandText, then just simply do this:
Quote:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(Minigun[playerid] == 1) return SendClientMessage(playerid, -1, "You can't use commands in DM Minigame!");
// your commands here
return 0;
}
|
2. If you're using the ZCMD include then, you can use it's default (ZCMD) call back known as
Quote:
OnPlayerCommandReceived(playerid, cmdtext[])
|
>> Ask if you need info about the second method.
- Note: I've used the global variable, as it is much a lot easier than using the function " SetPVarInt ". But if you want to use that instead, I can guide you in that too.
"Sorry about my bad English n if you find this good, don't forget to give me +1. Also, this is my first time, guiding someone!"
Regards, - Noob Programmer Akbaig. (Started programming one year ago)