Czy moglby mi ktos przerobic ten plugin tak aby po wpisaniu /camo wybieralo losowy model(przeciwnika)
(jeden z czterech), bo gdy teraz probuje sie przemienic za kazdym razem wlacza sie (gdy jestem w ct model pheonix'a connexion), a (gdy jetsem w terro seal'a team 6) czyli tych pierwszych modeli?
Kod:
/* Plugin generated by AMXX-Studio */
/* No Warranties on this plugin */
/*
* www.amx-board.com
*
* Many help form [ --<-@ ] Black Rose and ^_^Satan^_^
* Thx you guys
*
*
* PLUGIN INFO
*
* say \camouflage // client cmd
* say_team \camouflage // client cmd
* say \camo // client cmd
* say_team \camo // client cmd
* amx_camouflage <1/0> // enable / disable by admin
* amx_cvar mp_camocost "1-16000" // changes the cost of the camouflage
* amx_camo "target" //give target camouflage
*
* Modules Required: Fun; Cstrike
*
*
*/
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#define MAX_PLAYERS 32
new PLUGIN[]="Camouflage"
new AUTHOR[]="wouter"
new VERSION[]="1.4"
new bool:HasCamo[33]
new CTModels[] =
{
"urban", "gsg9",
"gign", "sas"
}
new TModels[] =
{
"terror", "leet",
"artic", "guerilla"
}
public client_connect(id) {
HasCamo[id] = false
}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg", "DeathEvent", "a")
register_event("ResetHUD", "ResetHud", "a")
register_event("StatusValue", "statusvalue", "be", "1=2")
register_clcmd("say /camouflage", "cmd_camouflage")
register_clcmd("say_team /camouflage", "cmd_camouflage")
register_clcmd("say /camo", "cmd_camouflage")
register_clcmd("say_team /camo", "cmd_camouflage")
register_clcmd("say /camohelp", "camo_help")
register_cvar("amx_camouflage", "1")
register_cvar("mp_camocost", "8000")
register_concmd("amx_camo","cmd_camo",ADMIN_BAN,"<target>")
set_task(600.0,"info_print",0,"",0,"b" )
}
public info_print(id) {
client_print(id, print_chat, "[Camouflage] Say /camohelp for some info")
return PLUGIN_CONTINUE
}
public camo_help(id) {
show_motd(id, "<html><head><title>Camouflage Help</title></head><body bgcolor=^"#000000^" text=^"#FF9900^"><body>~ What ?
A Camouflage will make you look like your enemy
~ How ?
say /camouflage
say_team /camouflage
say /camo
say_team /camo</body></html>")
}
public cmd_camouflage(id) {
if ( ! get_cvar_num("amx_camouflage") )
return PLUGIN_HANDLED
new money = cs_get_user_money(id)
new CsTeams:team = cs_get_user_team(id)
new CamoCost = get_cvar_num("mp_camocost")
if ( !is_user_alive(id) ) {
client_print(id, print_chat, "[Camouflage] You are not alive!")
return PLUGIN_HANDLED
}
if ( money < CamoCost ) {
client_print(id, print_chat, "[Camouflage] You need %d $ to buy a camouflage", get_cvar_num( "mp_camocost" ) )
return PLUGIN_HANDLED
}
if ( HasCamo[id] == false ) {
cs_set_user_money( id, cs_get_user_money(id) - CamoCost )
client_print( id, print_chat, "[Camouflage] You bought a camouflage!" )
HasCamo[id] = true
if (team == CS_TEAM_CT) {
cs_set_user_model(id, TModels)
return PLUGIN_CONTINUE;
}
else if (team == CS_TEAM_T) {
cs_set_user_model(id, CTModels)
return PLUGIN_CONTINUE
}
}
else if (HasCamo[id] == true) {
client_print( id, print_chat, "[Camouflage] You allready have a camouflage!" )
return PLUGIN_CONTINUE
}
return PLUGIN_HANDLED
}
public statusvalue(id)
{
if ( ! get_cvar_num("amx_camouflage") )
return PLUGIN_HANDLED
new target = read_data(2)
if (!target)
return PLUGIN_HANDLED
new name1[32], name2[32]
get_user_name(id, name1, 31) // aimer
get_user_name(target, name2, 31) // aimed
if (get_user_team(id) != get_user_team(target))
{
// ENEMY
}
else
{
//TEAM MATE
if(HasCamo[target] == true)
{
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(id, "DON't SHOOT %s", name2)
}
}
return PLUGIN_HANDLED
}
public DeathEvent() {
if ( ! get_cvar_num("amx_camouflage") )
return PLUGIN_HANDLED
new id = read_data(2)
if ( HasCamo[id] == true ) {
set_task( 1.0, "reset_model", id )
}
return PLUGIN_HANDLED
}
public ResetHud(id) {
if ( ! get_cvar_num("amx_camouflage") )
return PLUGIN_HANDLED
new CsTeams:team = cs_get_user_team(id)
if ( HasCamo[id] == true ) {
if (team == CS_TEAM_CT) {
cs_set_user_model(id, TModels)
}
else if (team == CS_TEAM_T) {
cs_set_user_model(id, CTModels)
}
}
return PLUGIN_HANDLED
}
public reset_model(id) {
cs_reset_user_model(id)
HasCamo[id] = false
}
public cmd_camo(id) { // Admin cmd
if (!(get_user_flags(id)&ADMIN_BAN)) {
console_print(id,"[Camouflage] You have no access to this command")
return PLUGIN_HANDLED
}
if (read_argc() == 0) {
console_print(id,"[Camouflage] Usage: amx_camo <target>")
return PLUGIN_HANDLED
}
new user[32], AdminName[32], uid
read_argv(1,user,31)
get_user_name(id,AdminName,31)
uid = find_player("bfl",user)
if (uid == 0) {
console_print(id,"[Camouflage] Player *%s* not found", user)
return PLUGIN_HANDLED
}
new CsTeams:team = cs_get_user_team(uid)
if ( HasCamo[uid] == false ) {
switch (get_cvar_num("amx_show_activity")) {
case 2: client_print(0,print_chat,"ADMIN %s: Gave someone a Camouflage",AdminName)
case 1: client_print(0,print_chat,"ADMIN: Gave someone a Camouflage")
}
client_print( uid, print_chat, "[Camouflage] You have gain a camouflage!" )
console_print(id,"[Camouflage] You gave *%s* a Camouflage", user)
HasCamo[uid] = true
if (team == CS_TEAM_CT) {
cs_set_user_model(uid, TModels)
return PLUGIN_CONTINUE;
}
else if (team == CS_TEAM_T) {
cs_set_user_model(uid, CTModels)
return PLUGIN_CONTINUE
}
}
else if (HasCamo[uid] == true) {
client_print(id, print_console, "[Camouflage] *%s* allread ownes a Camouflage",user)
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang2067\\ f0\\ fs16 \n\\ par }
*/