[REQ] How can I do this?

Started by Gulk, May 10, 2015, 10:34 AM

Previous topic - Next topic

Gulk

I am attempting to give some skins more than 3 weapons with "AddClass" and it doesn't allow it. 3 is max.

I want to give certain skins armour too, upon spawn - [Cop] 50 max armour - [Vice City Crusader] 100 max armour.

nothing i try worked

SantaClaus

#1
Maybe using player.Armour and player.GiveWeapon in OnPlayerSpawn. Maybe something like this (not tested):

function onPlayerSpawn( player )
{
   if(player.Class == TEAM_COPS){
     player.Armour = 50;
   }
    if(player.Class == TEAM_VCR){
    player.Armour = 100;
   }

// For weapons

   if(player.Class == TEAM_XXX)
   {
     player.GiveWeapon(stubID, ammo); // Wep 1
     player.GiveWeapon(rocketID, ammo); // Wep 2
   }

}

if TEAM_XXX has 3 weapons in AddClass, then add the extra ones by using the function player.GiveWeapon.

TEAM_COPS, TEAM_VCR and TEAM_XXX refer to the player.Class (classid).

DizzasTeR

#2
const SKIN_COP = 1;
const SKIN_CIV = 130;

function onPlayerSpawn( player )
{
# Just create your classes however you want, using config or addclass and use this simple thing.
        # Using the skin ids to recognize the class, we can easily give our desired things
# Don't forget to use your own skin IDs constants up there.

switch( player.Skin )
{
case SKIN_COP:
player.Armour = 50;
                player.GiveWeapon( weapon, ammo);
                player.GiveWeapon( weapon, ammo);
break;

case SKIN_CIV:
player.Armour = 100;
                player.GiveWeapon( weapon, ammo);
                player.GiveWeapon( weapon, ammo);
break;
}
}

Simple as that :)

Stormeus

Support threads are not a place for condescending remarks and personal debates. Thread cleaned.

Gulk

Done,

const SKIN_COP1 = 166;
 const SKIN_COP2 = 120;
 const SKIN_VCC = 123;
 const SKIN_SS1 = 162;
 const SKIN_SS2 = 117;

function onPlayerSpawn( player )
{
switch( player.Skin )
 {
  case SKIN_COP1:
                player.Armour = 50;
  break;
 
   case SKIN_COP2:
                player.Armour = 50;
  break;

  case SKIN_VCC:
  player.Armour = 100;
                player.GiveWeapon( 27, 200);
                player.GiveWeapon( 15, 12);
  break;
 
  case SKIN_SS1:
                player.GiveWeapon( 25, 250);
  break;
 
  case SKIN_SS2:
                player.GiveWeapon( 25, 250);
  break;
 }
}

Thanks all

Thijn

You can combine the cop and SS skins like so:
case SKIN_COP1:
case SKIN_COP2:
    player.Armour = 50;
break;