Need Pack in every spawn.

Started by Gito Baloch, Apr 04, 2020, 10:22 AM

Previous topic - Next topic

Gito Baloch

Hello Scripters!
I've make Pack
else if (cmd =="pack1")
  {
  MessagePlayer("[#ff0047]You took [#ffffff]PACK 1!",player);
  player.Disarm();
  player.SetWeapon(21,10000);
  player.SetWeapon(26,10000);
  player.SetWeapon(24,10000);
  player.SetWeapon(17,10000);
  }

when i type /pack1 in server i got weapons, but when i die and spawn i dont get that pack again? how do i do this.. Please help im begginer in scripting.
Programming is the language I speak, the world I shape, and the future I code

=RK=MarineForce

Try to UnderStand ME!

Gito Baloch

im getting error bro! packs doesn't exist
Programming is the language I speak, the world I shape, and the future I code

AroliS^

packs <- array(100,null);
else if (cmd =="pack1")
{
    if ( packs[ player.ID ] != 1 )
    {
        MessagePlayer("[#ff0047]You took [#ffffff]PACK 1!",player);
        packs[ player.ID ] = 1
    }
    else MessagePlayer( "fffffff, You already have this pack.",player);
}

///onplayerspawn
   
switch(packs[ player.ID ])
{
    case 1:
    {
        player.Disarm();
        player.SetWeapon(21,10000);
        player.SetWeapon(26,10000);
        player.SetWeapon(24,10000);
        player.SetWeapon(17,10000);
    }
    break;
}
Lemme love ya

Gito Baloch

Programming is the language I speak, the world I shape, and the future I code