[HELP]Disabling commands when in dm and race
#1

yo all,

well, i have a problem on my scripting for a week. I made disabling scriptings on my GM(new indm[MAX_PLAYERS]; bla bla ...), its done for DMs, but i have a race fs. I want to disable commands when the player in race too, but it wants an include(i think). How can i use "new indm[MAX_PLAYERS]" on my both of mods? (GM + FS) any diea?
Reply
#2

First check if the player is in the race then if they do disable commands.
And i dont know really what you mean cause you didnt give clear info of what you want.
You only typed bla bla the whole time ?

/Artix
Reply
#3

u know yrace, arnt u? i have yrace fs, race scriptings ar there, but dmz ar on my GM, i mean i want to disable commands when player in race,TOO(here is the opposition), and here is my dm command;
Код:
new indm[MAX_PLAYERS];

if(!strcmp(cmdtext, "/dm 1", true)){
   if(indm[playerid] == 0)
   {
   SetPlayerRandomSpawn1(playerid);
	 ResetPlayerWeapons(playerid);
   SetPlayerVirtualWorld(playerid,100);
	 SetPlayerInterior(playerid, 0);
   GivePlayerWeapon(playerid, 26, 999);
   GivePlayerWeapon(playerid, 32, 5999);
   SetPlayerHealth(playerid, 100.0);
   SetPlayerArmour(playerid, 100.0);
   SetPlayerWorldBounds(playerid,1162.9043,1095.9735,-1421.0227,-1524.3269);
	 GetPlayerName(playerid, var0, 25);
   format(var1, 256, "*** %s is at DeathMatch 1 now! (/dm 1 to join!).", var0);
   SendClientMessageToAll(0xFF9900AA, var1);
	 indm[playerid]=1;
	}
	else
	{
	SendClientMessage(playerid,COLOR_RED,"You didnt allow to use any command,you are in a DM ! (type /leave to leave)");
}
   return 1;
  }

public OnPlayerSpawn(playerid) {
indm[playerid]=0;
return 1;
}
and i need a inrace[MAX_PLAYERS] to put here(for disabling commands when player in race), but race scripts ar on fs, dms ar on gm, got the opposition?
Reply
#4

Then put it in the FS ? i still dont get it :S.
You have to explane better dude.

/Artix
Reply
#5

sorry, its because of my fckng english but i can explain it from msn, addin' u for it...

LR
Reply
#6

It is only one Variable that you set to 1 or 0 , so you can create if Statement and
check for value , if its is 1 block the cmd

Код:
if(value == 1)return SendClientMessage(...);
but you must Create Variable for every Player ( Max_Players )

new value[MAX_PLAYERS];

dont forget to Reset Variable if Player is leaving the Server ...
Reply
#7

Quote:
Originally Posted by BlackFoX
It is only one Variable that you set to 1 or 0 , so you can create if Statement and
check for value , if its is 1 block the cmd

Код:
if(value == 1)return SendClientMessage(...);
but you must Create Variable for every Player ( Max_Players )

new value[MAX_PLAYERS];

dont forget to Reset Variable if Player is leaving the Server ...
hmm, maybe here is the problem, i didnt reset variable on playerdc, it borns any problem? if yes, how?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)