06.02.2015, 13:27
Hi guys. Players can take minigun from dm's by using /goto command in dm's and just teleport to any players. And i need to block /goto command. How can i do it?
if(IsInMinigunArena[playerid] == 1) //if he was in the minigun arena when he used goto, this should be true
{
//disarm him
IsInMinigunArena[playerid] = 0; //set the variable to 0, because he is not there anymore
}
//Somewhere on your gamemode (Not in any function/stock) IsInMinigunArena[MAX_PLAYERS];
//OnPlayerCommandText
if (strcmp("/minigun", cmdtext, true, 10) == 0)
{
IsInMinigunArena[playerid] = 1;
SetPlayerPos(playerid, 00.0000, 00.0000, 00.0000);
return 1;
}
//OnPlayerCommandText
if (strcmp("/goto", cmdtext, true, 10) == 0)
{
if(IsInMinigunArena[playerid] != 0) return SendClientMessage(playerid, 0xFF0000C8, "You CANNOT Use This Command now!");
//Your /goto code
return 1;
}