vreau si eu un edit pt acest plugin
ca sa aiba :
[1] Viata - 1000
[2] Armura - 350
[3] Pachet grenazi - cate una din fiecare
[4] Pachet arme - cate una din fiecare arma + deagle
[5] Gravitate - 400
si sa aiba ca si comanda de lansare - /vmenu sau /powers
vip flag t[
[/code]
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#pragma semicolon 1
#define PLUGIN "Deathrun VIP"
#define VERSION "0.2"
#define AUTHOR "FaTzZu"
#define ACCES ADMIN_LEVEL_H // Aici schimbati accesul
new g_ScoreAttrib;
new cvar_speed, cvar_gravity, cvar_hp, cvar_ap;
new Has_Speed[33];
new Has_Chose [ 33 ];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR);
cvar_gravity = register_cvar("vip_gravity", "200");
cvar_speed = register_cvar("vip_speed", "1000");
cvar_hp = register_cvar("vip_hp", "1000");
cvar_hp = register_cvar("vip_ap", "999");
RegisterHam(Ham_Spawn, "player", "PlayerSpawm");
register_clcmd("say /vm", "drvip_menu");
register_clcmd("say_team /vm", "drvip_menu");
register_clcmd ("say /vip" , "wantvip" , -1);
register_clcmd ("say_team /vip" , "wantvip" , -1);
register_clcmd("say", "handle_say");
register_clcmd("say_team", "handle_say");
register_event( "CurWeapon", "CurWeapon", "be", "1=1" );
}
public CurWeapon( id )
{
if( Has_Speed[ id ] )
{
set_user_maxspeed( id, get_pcvar_float( cvar_speed ) );
}
}
public PlayerSpawm(id) {
new iPlayers [ 32 ];
new iNum;
get_players ( iPlayers, iNum );
for ( new i = 0; i < iNum; i++ )
{
Has_Chose [ iPlayers [ i ] ] = 0;
}
if(!is_user_alive(id))
return 1;
if(get_user_flags(id) & ACCES)
{
new CsTeams:team = cs_get_user_team(id);
switch(team)
{
case CS_TEAM_T:
{
set_user_health(id, get_pcvar_num(cvar_hp));
set_user_armor(id, get_pcvar_num(cvar_ap));
set_user_scoreattrib(id, 4);
Has_Speed[id] = false;
}
case CS_TEAM_CT:
{
strip_user_weapons(id);
set_user_health(id, get_pcvar_num(cvar_hp));
set_user_armor(id, get_pcvar_num(cvar_ap));
give_item(id, "weapon_usp");
cs_set_user_bpammo(id, CSW_USP, 100);
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_smokegrenade");
set_user_scoreattrib(id, 4);
Has_Speed[id] = false;
}
}
}
return 1;
}
public drvip_menu(id){
if ( Has_Chose [ id ] == 1 ) {
ColorChat( id, "^x01Ai folosit deja ^x04meniul ." );
}
if(get_user_team(id) == 1)
{
ColorChat(id, "^x01Doar^x04 CT^x01 pot folosi meniul");
return 1;
}
if(get_user_flags(id) & ACCES)
{
new menu = menu_create("\VIP Menu Deathrun:\r", "drvip_handler");
menu_additem(menu, "\Ak47r\", "1", 0);
menu_additem(menu, "\M4a1r\", "2", 0);
menu_additem(menu, "\Deagler\", "3", 0);
menu_additem(menu, "\Speedr\", "4", 0);
menu_additem(menu, "\Gravityr\", "5", 0);
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id, menu, 0);
}
else
{
ColorChat(id, "^x01Doar^x04 VIP^x01 pot folosi meniul");
return 1;
}
return 1;
}
public drvip_handler(id, menu, item){
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1:
{
give_item(id, "weapon_ak47");
cs_set_user_bpammo(id, CSW_AK47, 90);
ColorChat(id, "^x01Ai primit %i ^x04Ak47");
Has_Speed[id] = false;
Has_Chose[id] ++;
}
case 2:
{
give_item(id, "weapon_m4a1");
cs_set_user_bpammo(id, CSW_M4A1, 90);
ColorChat(id, "^x01Ai primit %i ^x04M4a1");
Has_Speed[id] = false;
Has_Chose[id] ++;
}
case 3:
{
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_DEAGLE, 32);
ColorChat(id, "^x01Ai primit %i ^x04Deagle");
Has_Speed[id] = false;
Has_Chose[id] ++;
}
case 4:
{
set_user_maxspeed(id, get_pcvar_float(cvar_speed));
ColorChat(id, "^x01Ai primit %i ^x04Speed");
Has_Speed[id] = true;
Has_Chose[id] ++;
}
case 5:
{
set_user_gravity(id, get_pcvar_float(cvar_gravity) / 800);
ColorChat(id, "^x01Ai primit ^x04Gravity");
Has_Speed[id] = false;
Has_Chose[id] ++;
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public print_adminlist(user) {
new adminnames[33][32];
new message[256];
new id, count, x, len;
for(id = 1 ; id <= get_maxplayers() ; id++)
if(is_user_connected(id))
if(get_user_flags(id) & ACCES)
get_user_name(id, adminnames[count++], 31);
len = format(message, 255, "^x04 VIP ONLINE: ");
if(count > 0) {
for(x = 0 ; x < count ; x++) {
len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"");
if(len > 96) {
print_message(user, message);
len = format(message, 255, "^x04 ");
}
}
print_message(user, message);
}
else {
len += format(message[len], 255-len, "No VIP online.");
print_message(user, message);
}
}
print_message(id, msg[]) {
message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id);
write_byte(id);
write_string(msg);
message_end();
}
public handle_say(id) {
new said[192];
read_args(said,192);
if(contain(said, "/vips") != -1)
set_task(0.1,"print_adminlist",id);
return PLUGIN_CONTINUE;
}
public wantvip(id) show_motd(id,"/addons/amxmodx/configs/vip.html");
stock set_user_scoreattrib(id, attrib = 0){
message_begin(MSG_BROADCAST, g_ScoreAttrib, _, 0);
write_byte(id);
write_byte(attrib);
message_end( );
}
stock ColorChat(const id, const input[], any:...) {
new count = 1, players[32];
static msg[191];
vformat(msg, 190, input, 3);
replace_all(msg, 190, "^x04", "^4");
replace_all(msg, 190, "^x01", "^1");
replace_all(msg, 190, "^x03", "^3");
if(id) players[0] = id;
else get_players(players, count, "ch"); {
for(new i = 0; i < count; i++) {
if(is_user_connected(players[i])) {
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
edit: si as vrea sa -mi spuneti cum sa sterg de pe addonsul lui skaraosky aia din hud "..::Contact skaraosky..."
Last edited by [ ] JigSaw[;x] on 06-12-2019, 18:22:56; edited 1 time in total |