Nie zrobisz identycznego z generatora, dlatego proszę o przerobienie pluginu.
#include <amxmodx>
#include <colorchat>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
new Array:g_Array, bool:g_Vip[33], skoki[33];
new const clips[]={0, 13, -0, 10, 1, 7, 0, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, 0, 50};
new const g_Langcmd[][]={"say /vips","say_team /vips","say /vipy","say_team /vipy"};
public plugin_init(){
register_plugin("VIP Ultimate", "12.3.0.2", "benio101 & speedkill");
RegisterHam(Ham_Spawn, "player", "SpawnedEventPre", 1);
register_forward(FM_CmdStart, "CmdStartPre");
register_event("DeathMsg", "DeathMsg", "a");
g_Array=ArrayCreate(64,32);
for(new i;i<sizeof g_Langcmd;i++){
register_clcmd(g_Langcmd[i], "ShowVips");
}
}
public client_authorized(id , const authid[]){
if(get_user_flags(id) & 524288 == 524288){
client_authorized_vip(id);
}
}
public client_authorized_vip(id){
g_Vip[id]=true;
new g_Name[64];
get_user_name(id,g_Name,charsmax(g_Name));
new g_Size = ArraySize(g_Array);
new szName[64];
for(new i = 0; i < g_Size; i++){
ArrayGetString(g_Array, i, szName, charsmax(szName));
if(equal(g_Name, szName)){
return 0;
}
}
ArrayPushString(g_Array,g_Name);
return PLUGIN_CONTINUE;
}
public client_disconnected(id){
if(g_Vip[id]){
client_disconnect_vip(id);
}
}
public client_disconnect_vip(id){
g_Vip[id]=false;
new Name[64];
get_user_name(id,Name,charsmax(Name));
new g_Size = ArraySize(g_Array);
new g_Name[64];
for(new i = 0; i < g_Size; i++){
ArrayGetString(g_Array, i, g_Name, charsmax(g_Name));
if(equal(g_Name,Name)){
ArrayDeleteItem(g_Array,i);
break;
}
}
}
public SpawnedEventPre(id){
if(g_Vip[id]){
if(is_user_alive(id)){
SpawnedEventPreVip(id);
}
}
}
public SpawnedEventPreVip(id){
set_user_footsteps(id,1);
skoki[id]=1;
new g_Model[64];
formatex(g_Model,charsmax(g_Model),"%s",get_user_team(id) == 1 ? "VipTT" : "VipCT");
cs_set_user_model(id,g_Model);
}
public CmdStartPre(id, uc_handle){
if(g_Vip[id]){
if(is_user_alive(id)){
CmdStartPreVip(id, uc_handle);
}
}
}
public CmdStartPreVip(id, uc_handle){
new flags = pev(id, pev_flags);
if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & IN_JUMP) && skoki[id]>0){
--skoki[id];
new Float:velocity[3];
pev(id, pev_velocity,velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id,pev_velocity,velocity);
} else if(flags & FL_ONGROUND && skoki[id]!=-1){
skoki[id] = 1;
}
}
public DeathMsg(){
new killer=read_data(1);
new victim=read_data(2);
if(is_user_alive(killer) && g_Vip[killer] && get_user_team(killer) != get_user_team(victim)){
DeathMsgVip(killer,victim,read_data(3));
}
}
public recharge(id){
new wid=get_user_weapon(id);
if(wid){
new weaponname[32], weid;
get_weaponname(wid, weaponname, 31);
weid=find_ent_by_owner(-1, weaponname, id);
if(weid){
cs_set_weapon_ammo(weid, clips[wid]);
}
}
}
public DeathMsgVip(kid,vid,hs){
recharge(kid);
}
public ShowVips(id){
new g_Name[64],g_Message[192];
new g_Size=ArraySize(g_Array);
for(new i = 0; i < g_Size; i++){
ArrayGetString(g_Array, i, g_Name, charsmax(g_Name));
add(g_Message, charsmax(g_Message), g_Name);
if(i == g_Size - 1){
add(g_Message, charsmax(g_Message), ".");
}
else{
add(g_Message, charsmax(g_Message), ", ");
}
}
ColorChat(id,GREEN,"^x03Vipy ^x04na ^x03serwerze: ^x04%s", g_Message);
return PLUGIN_CONTINUE;
}
public client_infochanged(id){
if(g_Vip[id]){
new szName[64];
get_user_info(id,"name",szName,charsmax(szName));
new Name[64];
get_user_name(id,Name,charsmax(Name));
if(!equal(szName,Name)){
ArrayPushString(g_Array,szName);
new g_Size=ArraySize(g_Array);
new g_Name[64];
for(new i = 0; i < g_Size; i++){
ArrayGetString(g_Array, i, g_Name, charsmax(g_Name));
if(equal(g_Name,Name)){
ArrayDeleteItem(g_Array,i);
break;
}
}
}
}
}
public plugin_end(){
ArrayDestroy(g_Array);
}
public plugin_precache(){
precache_model("models/player/VipCT/VipCT.mdl");
precache_model("models/player/VipTT/VipTT.mdl");
}
Z generatora