Making a minigame
#1

Код:
 	if (strcmp("/AirDM", cmdtext, true) == 0)
		{
		SetPlayerPos(playerid, 1445.0975,-1055.0232,213.3828);
		ResetPlayerWeapons(playerid);
		SetPlayerHealth(playerid, 100);
		GivePlayerWeapon(playerid, 30, 1000);
		GivePlayerWeapon(playerid, 29, 1000);
		GivePlayerWeapon(playerid, 18, 50);
		GivePlayerWeapon(playerid, 32, 1000);
		GivePlayerWeapon(playerid, 46, 1);
		GivePlayerWeapon(playerid, 26, 500);
  new name[MAX_PLAYER_NAME];
    new msg[256];
	GetPlayerName(playerid,name,MAX_PLAYER_NAME);
	format(msg,sizeof(msg),"%s [%i] has been teleported to Air Deathmatch Arena To Join Use [/Airdm].",name,playerid);
	SendClientMessageToAll(COLOR_GREEN,msg);
	 return 1;
    }
Its my code i want it to make a minigame.
When player do /airdm they will be teleportrd to the place and get weapons after 25 seconds and after getting weapon no one can join it till it ends.And the player who will win will get a rocket with 20 ammo.

Please Help
Reply
#2

Create a new variable, At the top:
new AirDM;

add to your /airdm command:
pawn Код:
AirDM ++;
if(AirDM == 5) return SendClientMessage(playerid,COLOR,"Sorry this minigame already has a max amount of people");
Change the '5' to the max ammount of people aloud to join it.

Then you will need to put a timer on it, and at the end of the timer, teleport the players back out of the minigame, and remember to set AirDM to 0
Reply
#3

Please explain i dont know script
tell me where to add which code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)