Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Sublime AMXX Editor v2.2 */
- #include <amxmodx>
- // #include <amxmisc>
- // #include <cstrike>
- #include <engine>
- // #include <fakemeta>
- #include <hamsandwich>
- #include <fun>
- // #include <xs>
- // #include <sqlx>
- #define PLUGIN "Respawn VIP"
- #define VERSION "1.0.0"
- #define AUTHOR "Filip."
- enum {
- SCOREATTRIB_ARG_PLAYERID = 1,
- SCOREATTRIB_ARG_FLAGS
- };
- enum ( <<= 1 ) {
- SCOREATTRIB_FLAG_NONE = 0,
- SCOREATTRIB_FLAG_DEAD = 1,
- SCOREATTRIB_FLAG_BOMB,
- SCOREATTRIB_FLAG_VIP
- };
- #define is_user_vip(%1) (get_user_flags(%1) & read_flags("t"))
- #define VIATA_LA_SPAWN 100
- #define ARMURA_LA_SPAWN 100
- #define VIATA_KILL 10
- #define VIATA_HS 15
- new jumpnum[33] = 0
- new bool:dojump[33] = false
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- RegisterHam(Ham_Spawn, "player", "OnSpawn", 1)
- register_event("DeathMsg", "DeathMSG", "a")
- register_message( get_user_msgid( "ScoreAttrib" ), "MessageScoreAttrib" ); // credite Exolent
- register_cvar("amx_maxjumps","2")
- register_cvar("amx_mjadminonly","0")
- }
- public MessageScoreAttrib( iMsgId, iDest, iReceiver ) { // credite Exolent
- new iPlayer = get_msg_arg_int( SCOREATTRIB_ARG_PLAYERID );
- if( is_user_vip(iPlayer) ) {
- set_msg_arg_int( SCOREATTRIB_ARG_FLAGS, ARG_BYTE, SCOREATTRIB_FLAG_VIP );
- }
- }
- public client_putinserver(playerid) {
- if(!is_user_vip(playerid)) return
- jumpnum[playerid] = 0
- dojump[playerid] = false
- new name[33]
- get_user_name(playerid, name, 32)
- ColorChat(0, "!t[ !gVIP !t] VIP-UL !g%s!t, S-A CONECTAT PE SERVER.", name)
- }
- public OnSpawn(playerid) {
- if(!is_user_vip(playerid) && !is_user_alive(playerid)) return
- set_user_health(playerid, get_user_health(playerid) + VIATA_LA_SPAWN)
- set_user_armor(playerid, get_user_armor(playerid) + VIATA_LA_SPAWN)
- give_item(playerid, "weapon_hegrenade")
- }
- public DeathMSG(playerid, victim, hs) {
- if(!is_user_vip(playerid) || playerid == victim) return
- set_user_health(playerid, get_user_health(playerid) + ((hs) ? VIATA_HS : VIATA_KILL))
- }
- public client_PreThink(id)
- {
- if(!is_user_alive(id)) return PLUGIN_CONTINUE
- if(get_cvar_num("amx_mjadminonly") && (!is_user_vip(id))) return PLUGIN_CONTINUE
- new nbut = get_user_button(id)
- new obut = get_user_oldbutton(id)
- if((nbut & IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut & IN_JUMP))
- {
- if(jumpnum[id] < get_cvar_num("amx_maxjumps"))
- {
- dojump[id] = true
- jumpnum[id]++
- return PLUGIN_CONTINUE
- }
- }
- if((nbut & IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
- {
- jumpnum[id] = 0
- return PLUGIN_CONTINUE
- }
- return PLUGIN_CONTINUE
- }
- public client_PostThink(id)
- {
- if(!is_user_alive(id)) return PLUGIN_CONTINUE
- if(get_cvar_num("amx_mjadminonly") && (!is_user_vip(id))) return PLUGIN_CONTINUE
- if(dojump[id] == true)
- {
- new Float:velocity[3]
- entity_get_vector(id,EV_VEC_velocity,velocity)
- velocity[2] = random_float(265.0,285.0)
- entity_set_vector(id,EV_VEC_velocity,velocity)
- dojump[id] = false
- return PLUGIN_CONTINUE
- }
- return PLUGIN_CONTINUE
- }
- stock ColorChat(const id, const input[], any:...) {
- new count = 1, players[32];
- static msg[191];
- vformat(msg, 190, input, 3);
- replace_all(msg, 190, "!g", "^4");
- replace_all(msg, 190, "!y", "^1");
- replace_all(msg, 190, "!t", "^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();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement