PLayFF-ForumPlugin
Bienvenu sur le Forum Vous aller decouvivre des Mode tuto plugin plein de hose se forum et en cours merci de vous inscrire ^^

Mode base builder

Voir le sujet précédent Voir le sujet suivant Aller en bas

Mode base builder

Message  -(GoOD|STrIKeR)- Haribo le Dim 18 Sep - 11:18

Mode basebuilder

par MAJID le Dim 19 Déc 2010, 12:41


Description:
Le mod basebuilder consiste à construire une base pendant que les tero (zombie) soit enfermet.
au bout d'un laps de temp les zombie sont liberé(par defaut 150sec)
Le but du jeu est pour les CT et de defendre leur base pour pas se fair tuer.
Le but du jeu est pour le terro et de reusire a monter et de tuer les CT (quand la base et possible)
trés fun Smile

Cvar:

bb_build_time <#> (Def: 150) // Temp de construction(ct)
bb_zombie_health <#> (Def: 2500) //La vie des zombie
bb_calc_maxbase <0/1> (Def: 0) // Total max personne par base survivors rule (total cts / 3) = max per base) Displayed at round start.
bb_tournament_mode <0/1> (Def: 0) // Removes team balancing and auto-joiner to make tournaments easier to run
bb_show_moving <0/1> (Def: 1) // Shows current and previous mover of an object being looked at
bb_block_gravity <0/1> (Def: 0) // Drops objects to floor (prevents "air" bases), allows stacking
bb_pain_shock_free <0/1> (Def: 0) // Gives admins with kick ability no knockback to rush bases easier as a zombie
bb_max_move_dist <#> (Def: 960) // If distance > #, then the object cannot be selected
bb_min_move_dist <#> (Def: 25) // If distance < #, then the object is moved to bb_min_dist_set's distance (helps prevent sticking self)
bb_min_dist_set <#> (Def: 50) // Distance object moved to
bb_health_time <#> (Def: 12) // HUD time for the health HUD message
bb_roundtime <0/1> (Def: 9) // Temp en minute de la partie (Temp de construction + le temp de défense de base)
bb_rounds <0/1> (Def: 4) // Total rounds par maps
bb_reset_blocks <0/1> (Def: 1) // Remetre les bloc en place
bb_claim_mode <0/1> (Def: 0) // Turn on claim mode where the player can claim a piece and be the only one able to move it
bb_claim_max <#> (Def: 6) // Max number of objects to claim, 0 = no limit to claimable objects
bb_give_nades <hsf> (Def: h) //Nades to give on gun selection h = HE, f = Flashbang s = Smoke
bb_weapons <a-x> (Def: abcdeghijlmnqrstuvwx) // Liste des armes dans le menu guns

Scout: a
XM1014: b
Mac-10: c
AUG: d
UMP45: e
SG550: f
Galil: g
Famas: h
AWP: i
MP5: j
M249: k
M3: l
M4A1: m
TMP: n
G3SG1: o
SG552: p
AK-47: q
P90: r
P228: s
Dual Elites: t
Fiveseven: u
USP: v
Glock18: w
Deagle: x

Plugin:
Mode ICI

Map:
bb_megabuild4
bb_basement6
bb_classic11
bb_corners7
bb_crete3
bb_divided3
bb_incline3
bb_infection2
bb_retribution5
bb_rooshin
bb_separation6
bb_septic4
bb_ultrabuild4
bb_lockout

Map 1er partie ICI
Map 2er partie ICI

Code :
Shop:

Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <engine>

#define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
#define Ham_Player_ResetMaxSpeed Ham_Item_PreFrame

new bool:g_HasSuperKnife[33], bool:g_HasSpeed[33]

new grenade_ct, m249_ct, superknife_ct, gravity_ct, gravity_cost_ct, g3sg1_ct, smoke_ct, flash_ct
new vitesse_t, vitesse_cost_t, gravity_t, gravity_cost_t, superknife_t, knife_multiplier, g_iMaxPlayers

public plugin_init()
{
// Plugin Info
register_plugin("Shop Base Builder", "1.0", "xxxx")

// HAMSANDWICH
RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage_Pre")
RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawn_Post", 1)
RegisterHam(Ham_Player_ResetMaxSpeed, "player", "Player_ResetMaxSpeed", 1)

register_event("CurWeapon","checkWeapon","be","1=1")

// GetMaxPlayers
g_iMaxPlayers = get_maxplayers()

// Commandes
register_clcmd("say /shop", "shopmenu")
register_clcmd("say shop", "shopmenu")
register_concmd("shop", "shopmenu")

// Prix de chaque Item Menu CT
superknife_ct = register_cvar("shop_superknife_ct", "16000")
grenade_ct = register_cvar("shop_grenade_ct", "5000")
gravity_ct = register_cvar("shop_gravity_ct", "0.75")
flash_ct = register_cvar("shop_flash_ct", "2000")
smoke_ct = register_cvar("shop_smoke_ct", "2000")
g3sg1_ct = register_cvar("shop_g3sg1_ct", "14000")
gravity_cost_ct = register_cvar("shop_cost_gravity_ct", "12000")
m249_ct = register_cvar("shop_m249_ct", "10000")

// Prix de chaque Item Menu T
vitesse_t = register_cvar("shop_maxspeed_t", "200")
vitesse_cost_t = register_cvar("shop_cost_maxspeed_t", "6000")
gravity_cost_t = register_cvar("shop_cost_gravity_t", "12000")
gravity_t = register_cvar("shop_gravity_t", "0.75")
superknife_t = register_cvar("shop_superknife_t", "16000")
knife_multiplier = register_cvar("shop_knife_damage", "154")
}

public plugin_precache()
{
precache_model("models/furien_superknife.mdl")
}

public client_putinserver(id)
{
g_HasSuperKnife[id] = false
g_HasSpeed[id] = false
}

public shopmenu(id)
{
new menu
new menuText[32]

if ( cs_get_user_team(id) == CS_TEAM_CT )
{
menu = menu_create("Shop Menu [CT]", "menu_ct")
formatex( menuText, charsmax(menuText), "Grenade - [%d $]", get_pcvar_num(grenade_ct) )
menu_additem(menu, menuText, "1")
formatex( menuText, charsmax(menuText), "Grenade Flash - [%d $]", get_pcvar_num(flash_ct) )
menu_additem(menu, menuText, "2")
formatex( menuText, charsmax(menuText), "Smoke Grenade - [%d $]", get_pcvar_num(smoke_ct) )
menu_additem(menu, menuText, "3")
formatex( menuText, charsmax(menuText), "Gravity - [%d $]", get_pcvar_num(gravity_cost_ct) )
menu_additem(menu, menuText, "4")
formatex( menuText, charsmax(menuText), "G3SG1 - [%d $]", get_pcvar_num(g3sg1_ct) )
menu_additem(menu, menuText, "5")
formatex( menuText, charsmax(menuText), "Mitrailleuse - [%d $]", get_pcvar_num(m249_ct) )
menu_additem(menu, menuText, "6")
formatex( menuText, charsmax(menuText), "Super Cut - [%d $]", get_pcvar_num(superknife_ct) )
menu_additem(menu, menuText, "7")
menu_setprop(menu, MPROP_EXITNAME, "Sortir")
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu)
}
else
{
menu = menu_create("Shop Menu [T]:", "menu_terro")
formatex( menuText, charsmax(menuText), "Vitesse - [%d $]", get_pcvar_num(vitesse_cost_t) )
menu_additem(menu, menuText, "1")
formatex( menuText, charsmax(menuText), "Gravity - [%d $]", get_pcvar_num(gravity_cost_t) )
menu_additem(menu, menuText, "2")
formatex( menuText, charsmax(menuText), "Super Cut - [%d $]", get_pcvar_num(superknife_t) )
menu_additem(menu, menuText, "3")
menu_setprop(menu, MPROP_EXITNAME, "Sortir")
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, menu)
}
}

public menu_ct(id, menu, item)
{
if (item == MENU_EXIT) return PLUGIN_HANDLED

// Obtenir l'info de l'item
new info[3]
new access, callback
menu_item_getinfo(menu, item, access, info, 2, _, _, callback)

new key = str_to_num(info)

switch(key)
{
case 1:
{
if ( cs_get_user_team(id) == CS_TEAM_T )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux pas acheter un item des ct quand tu es terro !")
return PLUGIN_HANDLED
}
if ( !is_user_alive(id) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux rien acheter quand tu es ^x03mort ^x01!")
return PLUGIN_HANDLED
}
if ( user_has_weapon(id, CSW_HEGRENADE) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu as déjà cet item !")
return PLUGIN_HANDLED
}
new user_money = cs_get_user_money(id)
new grenade_count = get_pcvar_num(grenade_ct)
if ( user_money < grenade_count )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu n'as ^x03pas assez d'argent ^x01pour acheter cet item !")
return PLUGIN_HANDLED
}
else
{
cs_set_user_money(id, user_money - grenade_count)
give_item(id, "weapon_hegrenade")
print_color(id, id, 0, "^x04X[T]S^x01 Tu viens d'acheter une^x03 Grenade^x01 !")
}
}
case 2:
{
if ( cs_get_user_team(id) == CS_TEAM_T )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux pas acheter un item des ct quand tu es terro !")
return PLUGIN_HANDLED
}
if ( !is_user_alive(id) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux rien acheter quand tu es ^x03mort ^x01!")
return PLUGIN_HANDLED
}
if ( user_has_weapon(id, CSW_FLASHBANG) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu as déjà cet item !")
return PLUGIN_HANDLED
}
new user_money = cs_get_user_money(id)
new flash_count = get_pcvar_num(flash_ct)
if ( user_money < flash_count )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu n'as ^x03pas assez d'argent ^x01pour acheter cet item !")
return PLUGIN_HANDLED
}
else
{
cs_set_user_money(id, user_money - flash_count)
give_item(id, "weapon_flashbang")
print_color(id, id, 0, "^x04X[T]S^x01 Tu viens d'acheter une^x03 Flash grenade^x01 !")
}
}
case 3:
{
if ( cs_get_user_team(id) == CS_TEAM_T )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux pas acheter un item des ct quand tu es terro !")
return PLUGIN_HANDLED
}
if ( !is_user_alive(id) )
{
print_color(id, id, 0, "^x04[Shop]^x01 Tu ne peux rien acheter quand tu es ^x03mort ^x01!")
return PLUGIN_HANDLED
}
if ( user_has_weapon(id, CSW_SMOKEGRENADE) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu as déjà cet item !")
return PLUGIN_HANDLED
}
new user_money = cs_get_user_money(id)
new smoke_count = get_pcvar_num(smoke_ct)
if ( user_money < smoke_count )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu n'as ^x03pas assez d'argent ^x01pour acheter cet item !")
return PLUGIN_HANDLED
}
else
{
cs_set_user_money(id, user_money - smoke_count)
give_item(id, "weapon_smokegrenade")
print_color(id, id, 0, "^x04X[T]S^x01 Tu viens d'acheter une ^x03 SmokeGrenade ^x01!")
}
}
case 4:
{
if ( cs_get_user_team(id) == CS_TEAM_T )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux pas acheter un item des ct quand tu es terro !")
return PLUGIN_HANDLED
}
if ( !is_user_alive(id) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux rien acheter quand tu es ^x03mort ^x01!")
return PLUGIN_HANDLED
}
new user_money = cs_get_user_money(id)
new gravity_count = get_pcvar_num(gravity_cost_ct)
if ( user_money < gravity_count )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu n'as ^x03pas assez d'argent ^x01pour acheter cet item !")
return PLUGIN_HANDLED
}
else
{
cs_set_user_money(id, user_money - gravity_count)
set_user_gravity(id, get_pcvar_float(gravity_ct))
print_color(id, id, 0, "^x04X[T]S^x01 Tu viens d'acheter de la^x03 Gravity^x01 !")
}
}
case 5:
{
if ( cs_get_user_team(id) == CS_TEAM_T )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux pas acheter un item des ct quand tu es terro !")
return PLUGIN_HANDLED
}
if ( !is_user_alive(id) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux rien acheter quand tu es ^x03mort ^x01!")
return PLUGIN_HANDLED
}
if ( user_has_weapon(id, CSW_G3SG1) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu as déjà cet item !")
return PLUGIN_HANDLED
}
new user_money = cs_get_user_money(id)
new g3sg1_count = get_pcvar_num(g3sg1_ct)
if ( user_money < g3sg1_count )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu n'as ^x03pas assez d'argent ^x01pour acheter cet item !")
return PLUGIN_HANDLED
}
else
{
cs_set_user_money(id, user_money - g3sg1_count)
strip_user_weapons(id)
give_item(id, "weapon_g3sg1")
cs_set_user_bpammo(id, CSW_G3SG1, 90)
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 50)
print_color(id, id, 0, "^x04X[T]S^x01 Tu viens d'acheter un^x03 G3SG1 ^x01 !")
}
}
case 6:
{
if ( cs_get_user_team(id) == CS_TEAM_T )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux pas acheter un item des ct quand tu es terro !")
return PLUGIN_HANDLED
}
if ( !is_user_alive(id) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux rien acheter quand tu es ^x03mort ^x01!")
return PLUGIN_HANDLED
}
if ( user_has_weapon(id, CSW_M249) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu as déjà cet item !")
return PLUGIN_HANDLED
}
new user_money = cs_get_user_money(id)
new m249_count = get_pcvar_num(m249_ct)
if ( user_money < m249_count )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu n'as ^x03pas assez d'argent ^x01pour acheter cet item !")
return PLUGIN_HANDLED
}
else
{
cs_set_user_money(id, user_money - m249_count)
strip_user_weapons(id)
give_item(id, "weapon_m249")
cs_set_user_bpammo(id, CSW_M249, 250)
give_item(id, "weapon_deagle")
cs_set_user_bpammo(id, CSW_DEAGLE, 50)
print_color(id, id, 0, "^x04X[T]S^x01 Tu viens d'acheter une^x03 m249 ^x01 !")
}
}
case 7:
{
if ( cs_get_user_team(id) == CS_TEAM_T )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux pas acheter un item des terros quand tu es terro !")
return PLUGIN_HANDLED
}
if ( !is_user_alive(id) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux rien acheter quand tu es ^x03mort ^x01!")
return PLUGIN_HANDLED
}
if ( g_HasSuperKnife[id] )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu as déjà cet item !")
return PLUGIN_HANDLED
}
new user_money = cs_get_user_money(id)
new superknife_count = get_pcvar_num(superknife_ct)
if ( user_money < superknife_count )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu n'as ^x03pas assez d'argent ^x01pour acheter cet item !")
return PLUGIN_HANDLED
}
else
{
cs_set_user_money(id, user_money - superknife_count)
g_HasSuperKnife[id] = true
print_color(id, id, 0, "^x04X[T]S^x01 Tu viens d'acheter un^x03 Super Couteau ^x01 !")
}
}

}
return PLUGIN_CONTINUE;
}

public menu_terro(id, menu, item)
{
if (item == MENU_EXIT) return PLUGIN_HANDLED

// Obtenir l'info de l'item
new info[3]
new access, callback
menu_item_getinfo(menu, item, access, info, 2, _, _, callback)

new key = str_to_num(info)

switch (key)
{
case 1:
{
if ( cs_get_user_team(id) == CS_TEAM_CT )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux pas acheter un item des terros quand tu es ct !")
return PLUGIN_HANDLED
}
if ( !is_user_alive(id) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux rien acheter quand tu es ^x03mort ^x01!")
return PLUGIN_HANDLED
}
new user_money = cs_get_user_money(id)
new vitesse_count = get_pcvar_num(vitesse_cost_t)
if ( user_money < vitesse_count )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu n'as ^x03pas assez d'argent ^x01pour acheter cet item !")
return PLUGIN_HANDLED
}
else
{
cs_set_user_money(id, user_money - vitesse_count)
g_HasSpeed[id] = true
set_user_maxspeed ( id , get_pcvar_float ( vitesse_t ) )
print_color(id, id, 0, "^x04X[T]S^x01 Tu viens d'acheter de la ^x03 Vitesse ^x01 !")
}
}
case 2:
{
if ( cs_get_user_team(id) == CS_TEAM_CT )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux pas acheter un item des ct quand tu es ct !")
return PLUGIN_HANDLED
}
if ( !is_user_alive(id) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux rien acheter quand tu es ^x03mort ^x01!")
return PLUGIN_HANDLED
}
new user_money = cs_get_user_money(id)
new gravity_count = get_pcvar_num(gravity_cost_t)
if ( user_money < gravity_count )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu n'as ^x03pas assez d'argent ^x01pour acheter cet item !")
return PLUGIN_HANDLED
}
else
{
cs_set_user_money(id, user_money - gravity_count)
set_user_gravity(id, get_pcvar_float(gravity_t) )
print_color(id, id, 0, "^x04X[T]S^x01 Tu viens d'acheter de la^x03 Gravity^x01 !")
}
}
case 3:
{
if ( cs_get_user_team(id) == CS_TEAM_CT )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux pas acheter un item des terros quand tu es ct !")
return PLUGIN_HANDLED
}
if ( !is_user_alive(id) )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu ne peux rien acheter quand tu es ^x03mort ^x01!")
return PLUGIN_HANDLED
}
if ( g_HasSuperKnife[id])
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu as déjà cet item !")
return PLUGIN_HANDLED
}
new user_money = cs_get_user_money(id)
new superknife_count = get_pcvar_num(superknife_t)
if ( user_money < superknife_count )
{
print_color(id, id, 0, "^x04X[T]S^x01 Tu n'as ^x03pas assez d'argent ^x01pour acheter cet item !")
return PLUGIN_HANDLED
}
else
{
cs_set_user_money(id, user_money - superknife_count)
g_HasSuperKnife[id] = true
print_color(id, id, 0, "^x04X[T]S^x01 Tu viens d'acheter un^x03 Super Couteau ^x01 !")
}
}
}
return PLUGIN_CONTINUE;
}

//Les degat augmenter du super knife
public ham_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_bits)
{
if ( IsPlayer(attacker) && g_HasSuperKnife[attacker] && inflictor == attacker && get_user_weapon(attacker) == CSW_KNIFE )
{
SetHamParamFloat( 4, damage * get_pcvar_float(knife_multiplier) )
}
}

public ham_PlayerSpawn_Post(id)
{
g_HasSuperKnife[id] = false
g_HasSpeed[id] = false
}

public Player_ResetMaxSpeed ( id )
{
if ( is_user_alive ( id ) && g_HasSpeed[id] && get_user_maxspeed ( id ) != 0.1 )
{
set_user_maxspeed ( id , get_pcvar_float ( vitesse_t ) )
}
}

// Model du superknife
public checkWeapon(id)
{
if(g_HasSuperKnife[id])
{
new Clip, Ammo, Weapon = get_user_weapon(id, Clip, Ammo)

if(Weapon == CSW_KNIFE)
{
entity_set_string(id, EV_SZ_viewmodel, "models/furien_superknife.mdl")
}
}
}

// Message colorés
public print_color(id, cid, color, const message[], any:...)
{
new msg[192]
vformat(msg, charsmax(msg), message, 5)
new param
if (!cid) return
else param = cid
new team[32]
get_user_team(param, team, 31)
switch (color)
{
case 0: msg_teaminfo(param, team)
case 1: msg_teaminfo(param, "TERRORIST")
case 2: msg_teaminfo(param, "CT")
case 3: msg_teaminfo(param, "SPECTATOR")
}
if (id) msg_saytext(id, param, msg)
else msg_saytext(0, param, msg)
if (color != 0) msg_teaminfo(param, team)
}

msg_saytext(id, cid, msg[])
{
message_begin(id ? MSG_ONE : MSG_ALL, get_user_msgid("SayText"), _, id)
write_byte(cid)
write_string(msg)
message_end()
}

msg_teaminfo(id, team[])
{
message_begin(MSG_ONE, get_user_msgid("TeamInfo"), _, id)
write_byte(id)
write_string(team)
message_end()
}

conseille utiliser web conpiler ak pour votre plugin soit parfait

-(GoOD|STrIKeR)- Haribo
Admin

Messages : 68
Date d'inscription : 18/09/2011

Voir le profil de l'utilisateur http://tutoriel-pluging-mod.1forumgratuit.com

Revenir en haut Aller en bas

Voir le sujet précédent Voir le sujet suivant Revenir en haut

- Sujets similaires

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum