I have now that plugin parachute but i dont want for cs i want for a other mod but i dont know how .I cant script maybe you can help me for that scripten plz help me
Code:
*******************************************************************************/
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
new bool:has_parachute[33]
new para_ent[33]
new gCStrike = 0
#define PARACHUTE_LEVEL ADMIN_LEVEL_A
public plugin_init()
{
register_plugin("AMX Parachute", "1.0", "KRoT@L/JTP10181")
register_cvar("sv_parachute", "1" )
if (cstrike_running()) gCStrike = true
if (gCStrike) {
register_clcmd("say buy_parachute", "buy_parachute")
register_cvar("parachute_cost", "1000")
register_concmd("amx_parachute", "give_parachute", PARACHUTE_LEVEL, "<nick, #userid or @team>" )
}
register_event("ResetHUD", "newSpawn", "be")
register_event("DeathMsg", "death_event", "a")
}
public plugin_natives()
{
set_module_filter("module_filter")
set_native_filter("native_filter")
}
public module_filter(const module[])
{
if (!cstrike_running() && equali(module, "cstrike")) {
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public native_filter(const name[], index, trap)
{
if (!trap) return PLUGIN_HANDLED
return PLUGIN_CONTINUE
}
public plugin_precache()
{
precache_model("models/parachute.mdl")
}
public client_connect(id)
{
parachute_reset(id)
}
public client_disconnect(id)
{
parachute_reset(id)
}
public death_event()
{
new id = read_data(2)
parachute_reset(id)
}
parachute_reset(id)
{
if(para_ent[id] > 0) {
remove_entity(para_ent[id])
}
has_parachute[id] = false
para_ent[id] = 0
}
public newSpawn(id)
{
if(para_ent[id] > 0) {
remove_entity(para_ent[id])
para_ent[id] = 0
}
if (!gCStrike || access(id,PARACHUTE_LEVEL)) {
has_parachute[id] = true
}
}
public buy_parachute(id)
{
if (!gCStrike) return PLUGIN_CONTINUE
if (!get_cvar_num("sv_parachute")) {
client_print(id, print_chat, "[AMXX] Parachute plugin is disabled")
return PLUGIN_HANDLED
}
if (has_parachute[id]) {
client_print(id, print_chat, "[AMXX] You already have a parachute")
return PLUGIN_CONTINUE
}
if (!is_user_connected(id)) return PLUGIN_HANDLED
new money = cs_get_user_money(id)
new cost = get_cvar_num("parachute_cost")
if (money < cost) {
client_print(id, print_chat, "[AMXX] You don't have enough moneyfor a parachute - Costs $%i", cost)
return PLUGIN_CONTINUE
}
cs_set_user_money(id, money - cost)
client_print(id, print_chat, "[AMXX] You have bought a parachute. To use it, press +use while falling.")
has_parachute[id] = true
return PLUGIN_CONTINUE
}
public give_parachute(id, level, cid) {
if (!gCStrike) return PLUGIN_CONTINUE
if(!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED
if (!get_cvar_num("sv_parachute")) {
client_print(id, print_chat, "[AMXX] Parachute plugin is disabled")
return PLUGIN_HANDLED
}
new arg[32], name[32], name2[32], authid[35], authid2[35]
read_argv(1,arg,31)
get_user_name(id,name,31)
get_user_authid(id,authid,34)
if (arg[0]=='@'){
new players[32], inum
if (equali("T",arg[1])) copy(arg[1],31,"TERRORIST")
if (equali("ALL",arg[1])) get_players(players,inum)
else get_players(players,inum,"e",arg[1])
if (inum == 0) {
console_print(id,"No clients in such team")
return PLUGIN_HANDLED
}
for(new a = 0; a < inum; a++) {
has_parachute[players[a]] = true
}
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s: gave a parachute to ^"%s^" players",name,arg[1])
case 1: client_print(0,print_chat,"ADMIN: gave a parachute to ^"%s^" players",arg[1])
}
console_print(id,"[AMXX] You gave a parachute to ^"%s^" players",arg[1])
log_amx("^"%s<%d><%s><>^" gave a parachute to ^"%s^"", name,get_user_userid(id),authid,arg[1])
}
else {
new player = cmd_target(id,arg,6)
if (!player) return PLUGIN_HANDLED
has_parachute[player] = true
get_user_name(player,name2,31)
get_user_authid(player,authid2,34)
switch(get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s: gave a parachute to ^"%s^"",name,name2)
case 1: client_print(0,print_chat,"ADMIN: gave a parachute to ^"%s^"",name2)
}
console_print(id,"[AMXX] You gave a parachute to ^"%s^"", name2)
log_amx("^"%s<%d><%s><>^" gave a parachute to ^"%s<%d><%s><>^"", name,get_user_userid(id),authid,name2,get_user_userid(player),authid2)
}
return PLUGIN_HANDLED
}
public client_PreThink(id)
{
if (!get_cvar_num("sv_parachute")) return
if (!is_user_alive(id) || !has_parachute[id]) return
if (para_ent[id] > 0 && (get_entity_flags(id) & FL_ONGROUND)) {
remove_entity(para_ent[id])
para_ent[id] = 0
return
}
if (get_user_button(id) & IN_USE) {
new Float:velocity[3]
entity_get_vector(id, EV_VEC_velocity, velocity)
if (velocity[2] < 0.0) {
if(para_ent[id] == 0) {
para_ent[id] = create_entity("info_target")
if(para_ent[id] > 0) {
entity_set_model(para_ent[id], "models/parachute.mdl")
entity_set_int(para_ent[id], EV_INT_movetype, MOVETYPE_FOLLOW)
entity_set_edict(para_ent[id], EV_ENT_aiment, id)
}
}
if (para_ent[id] > 0) {
velocity[2] = (velocity[2] + 40.0 < -100) ? velocity[2] + 40.0 : -100.0
entity_set_vector(id, EV_VEC_velocity, velocity)
if (entity_get_float(para_ent[id], EV_FL_frame) < 0.0 || entity_get_float(para_ent[id], EV_FL_frame) > 254.0) {
if (entity_get_int(para_ent[id], EV_INT_sequence) != 1) {
entity_set_int(para_ent[id], EV_INT_sequence, 1)
}
entity_set_float(para_ent[id], EV_FL_frame, 0.0)
}
else {
entity_set_float(para_ent[id], EV_FL_frame, entity_get_float(para_ent[id], EV_FL_frame) + 1.0)
}
}
}
else if (para_ent[id] > 0) {
remove_entity(para_ent[id])
para_ent[id] = 0
}
}
else if ((get_user_oldbutton(id) & IN_USE) && para_ent[id] > 0) {
remove_entity(para_ent[id])
para_ent[id] = 0
}
}