spawn minigun every 1 hour?
#1

I would like to make a global event like the title says Spawn Minigun. So when it hits 1 hour then give all online players a minugun and then after 3 minutes remove the minigun then spawn back the weapons of the players to original.

Is it possible?
Reply
#2

yes it is possible with a timer.
Reply
#3

^ Like what PT just said

Add a timer for an hour, when they spawned Minigun. Add a 30 min timer again, once removed. Call the 1 hour timer again.
Reply
#4

Код:
public OnGameModeInit()
{
    SetTimer("MinigunSpawn",60*(60*1000), true);
    return 1;
}

forward MinigunSpawn();
public MinigunSpawn()
{
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
       GivePlayerWeapon(playerid, 38, 10000);
   }
   SendClientMessageToAll(-1, "Minigun DM started. 3 minutes left");
   SetTimer("RemoveMiniguns",3*(60*1000), false);
}
forward RemoveMiniguns();
public RemoveMiniguns()
{
   new weapon, ammo;
   for(new i = 0; i < MAX_PLAYERS; i++)
   {
       GetPlayerWeaponData(i, 7, weapon, ammo);
       GivePlayerWeapon(i, 38, ammo*-1);
   }
   SendClientMessageToAll(-1, "Minigun DM ended.");
}
Actually I didn't test it, but I think it will work.
First it starts an 1 hour timer, when the timer reaches zero it gives minigun to all players.
After 3 minutes it removes miniguns from the players.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)