|
|
|
Here are a few classes that I have created for your enjoyment. They should look familiar. Just change the model to what ever you want. But first you need to change your class info section in multiplay_gamerules.cpp ln444:
if (pPlayer->m_iPlayerClass <= 0 || pPlayer->m_iPlayerClass > 2)
{ //This part of the code checks to see if m_iPlayerClass is less than 0 or greater than 2.
pPlayer->m_iPlayerClass = 1;
}
//Basic class everyone gets this
pPlayer->GiveNamedItem( "weapon_crowbar" );
pPlayer->GiveNamedItem( "weapon_handgrenade" );
pPlayer->GiveNamedItem( "weapon_handgrenade" );
if (pPlayer->m_iPlayerClass == 1) //If m_iPlayerClass is equal to 1...
{
//class one
}
else if (pPlayer->m_iPlayerClass == 2) //If m_iPlayerClass is equal to 2...
{
//class two
}
Scout
pPlayer->GiveNamedItem( "weapon_9mmhandgun" );
pPlayer->GiveAmmo( 68, "9mm", _9MM_MAX_CARRY );
g_engfuncs.pfnSetClientKeyValue( pPlayer->entindex(),
g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "model", "zombie"
);
g_engfuncs.pfnSetClientMaxspeed( ENT( pPlayer->pev ), 900);
ClientPrint(pPlayer->pev, HUD_PRINTTALK, "You are now scout class.");
Sniper
pPlayer->GiveNamedItem( "weapon_crossbow" );
pPlayer->GiveAmmo( AMMO_CROSSBOWCLIP_GIVE, "bolts", BOLT_MAX_CARRY );
pPlayer->GiveNamedItem( "weapon_9mmhandgun" );
g_engfuncs.pfnSetClientKeyValue( pPlayer->entindex(),
g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "model", "zombie"
);
pPlayer->pev->armorvalue=20;
g_engfuncs.pfnSetClientMaxspeed( ENT( pPlayer->pev ), 700);
ClientPrint(pPlayer->pev, HUD_PRINTTALK, "You are now sniper class.");
Soldier
pPlayer->GiveNamedItem( "weapon_shotgun" );
pPlayer->GiveNamedItem( "weapon_rpg" );
pPlayer->GiveAmmo( AMMO_RPGCLIP_GIVE, "rockets", ROCKET_MAX_CARRY );
g_engfuncs.pfnSetClientKeyValue( pPlayer->entindex(),
g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "model", "zombie"
);
pPlayer->pev->armorvalue=50;
g_engfuncs.pfnSetClientMaxspeed( ENT( pPlayer->pev ), 400);
ClientPrint(pPlayer->pev, HUD_PRINTTALK, "You are now soldier class.");
Demo
//This is the demo so he recieves more grenades
pPlayer->GiveNamedItem( "weapon_handgrenade" );
pPlayer->GiveNamedItem( "weapon_satchel" );
pPlayer->GiveNamedItem( "weapon_tripmine" );
pPlayer->GiveNamedItem( "weapon_handgrenade" );
pPlayer->GiveNamedItem( "weapon_satchel" );
pPlayer->GiveNamedItem( "weapon_tripmine" );
g_engfuncs.pfnSetClientKeyValue( pPlayer->entindex(),
g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "model", "zombie"
);
pPlayer->pev->armorvalue=50;
g_engfuncs.pfnSetClientMaxspeed( ENT( pPlayer->pev ), 500);
ClientPrint(pPlayer->pev, HUD_PRINTTALK, "You are now demo class.");
HWGuy
pPlayer->GiveNamedItem( "weapon_shotgun" );
pPlayer->GiveNamedItem( "weapon_mp5" );
pPlayer->GiveAmmo( 68, "9mm", _9MM_MAX_CARRY );
g_engfuncs.pfnSetClientKeyValue( pPlayer->entindex(),
g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "model", "zombie"
);
pPlayer->pev->armorvalue=200;
g_engfuncs.pfnSetClientMaxspeed( ENT( pPlayer->pev ), 300);
ClientPrint(pPlayer->pev, HUD_PRINTTALK, "You are now HWGuy class.");
Spy
pPlayer->GiveNamedItem( "weapon_9mmhandgun" );
pPlayer->GiveAmmo( 68, "9mm", _9MM_MAX_CARRY );
g_engfuncs.pfnSetClientKeyValue( pPlayer->entindex(),
g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "model", "zombie"
);
pPlayer->pev->armorvalue=15;
g_engfuncs.pfnSetClientMaxspeed( ENT( pPlayer->pev ), 800);
ClientPrint(pPlayer->pev, HUD_PRINTTALK, "You are now spy class.");
Any questions or suggestions should be sent to me: bigguy@valveworld.com