VIP 1.9 UPDATE !

In jos

descarca VIP 1.9 UPDATE !

Mesaj Scris de DarkArms la data de Lun Noi 14, 2016 6:46 pm

.:: Descriere ::.



Cu acest plugin userii care au vip au acces la mai multe iteme !


.:: Instalare ::.

1. Fisierul vip.sma il puneti in addons/amxmodx/scripting
2. Fisierul vip.amxx il puneti in addons/amxmodx/plugins
3. Fisierul buyvip.html il puneti in addons/amxmodx/configs
4. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
Cod:
vip.amxx
5. Fisierul vips.ini il puneti in addons/amxmodx/configs]
#0000FF

6. Schimbati mapa !

.:: Development (pentru scripteri)  ::.

Spoiler:

Cod:

/*///////////////////////////////\\\\\\\\\\
*
* set_user_vip
*
* Type : Native
*
* Usual : set_user_vip(index, 1=VIP on, 0=VIP OFF)
*/

native set_user_vip(id, value)



/*///////////////////////////////\\\\\\\\\\
*
* get_user_vip
*
* Type : Native
*
* Usual : return the vip value (1= is vip, 0=is not vip)
*/

native get_user_vip(id)


/*///////////////////////////////\\\\\\\\\\
*
* vip_putinserver
*
* Type : Forward
*
* Usual : called when VIP is putinserver
*/

forward vip_putinserver(id)


/*///////////////////////////////\\\\\\\\\\
*
* vip_connect
*
* Type : Forward
*
* Usual : called when VIP is connect to server
*/

forward vip_connect(id)


/*///////////////////////////////\\\\\\\\\\
*
* vip_disconnect
*
* Type : Forward
*
* Usual : called when VIP is disconnect from server
*/

forward vip_disconnect(id)

/*///////////////////////////////\\\\\\\\\\
*
* vip_spawn
*
* Type : Forward
*
* Usual : called when VIP is respawning
*/

forward vip_spawn(id)


/*///////////////////////////////\\\\\\\\\\
*
* vip_die
*
* Type : Forward
*
* Usual : called when VIP die
*/

forward vip_die(id)

/*///////////////////////////////\\\\\\\\\\
*
* vip_kill
*
* Type : Forward
*
* Usual : called when VIP is kill someone
*/

forward vip_kill(id)


/*///////////////////////////////\\\\\\\\\\
*
* vip_infochanged
*
* Type : Forward
*
* Usual : called when VIP is change his info(name,rate)
*/

forward vip_infochanged(id)

/*///////////////////////////////\\\\\\\\\\
*
* vip_think
*
* Type : Forward
*
* Usual : Return PlayerPreThink Function (only for vips)
*/

forward vip_think(id)

.:: Comenzi chat ::.

  • /vips
  • /vip
  • /vipmenu
  • /buyvip
  • /respawn (doar o data pe runda)



.:: Cvars ::.

  • vip_respawn "2"  // de cate ori se poate respawna vip-ul pe runda


.:: Imagini ::.










.:: Descarcare ::.

Spoiler:
/* AMX Mod X
* Vip Mod Plugin
*
* by LordOfNothing
*
* This file is part of AMX Mod X.
*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* In addition, as a special exception, the author gives permission to
* link the code of this program with the Half-Life Game Engine ("HL
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
* L.L.C ("Valve"). You must obey the GNU General Public License in all
* respects for all of the code used other than the HL Engine and MODs
* from Valve. If you modify this file, you may extend this exception
* to your version of the file, but you are not obligated to do so. If
* you do not wish to do so, delete this exception statement from your
* version.
*/



#include < amxmodx >
#include < amxmisc >
#include < fun >
#include < cstrike >
#include < hamsandwich >
#include < fakemeta >

new const PLUGIN [] = "VIP System";
new const VERSION [] = "1.9";
new const AUTHOR [] = "LordOfNothing";

new bool:VipUse[33];
new bool:SpeedOn[33];
new mespawn[33];
new bool:IsVip[33];

new xPut;
new xSpawn;
new xDie;
new xKill;
new xdisc;
new xscan;
new xcon;
new xinfo;

new respawn_cvar;

new bool:g_vip[33];

#define is_user_valid(%1) (1 <= %1 <= get_maxplayers())


#define is_user_vip(%1)    ( IsVip[%1] )

stock set_user_vip(id)
{
IsVip[id] = true;
}

stock remove_user_vip(id)
{
IsVip[id] = false;
}

enum Color
{
NORMAL = 1, // clients scr_concolor cvar color
YELLOW = 1, // NORMAL alias
GREEN, // Green Color
TEAM_COLOR, // Red, grey, blue
GREY, // grey
RED, // Red
BLUE, // Blue
}

new TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}


// This is for Read File
new Array:g_Stroke = Invalid_Array;

public plugin_init ( ) {

register_plugin ( PLUGIN, VERSION, AUTHOR );
RegisterHam(Ham_Spawn, "player", "Hook_Vip_Spawn", 1);
RegisterHam(Ham_Killed, "player", "HookKilledVip", 1);

register_clcmd ("say /vipmenu", "VipMenu");
register_clcmd ("say_team /vipmenu", "VipMenu");

register_clcmd("say /vips", "Vips_Online");
register_clcmd("say_team /vips", "Vips_Online");

register_clcmd("say /vip", "Vips_Online");
register_clcmd("say_team /vip", "Vips_Online");

register_event ( "CurWeapon", "CurrentWeapon", "be", "1=1" );

register_clcmd("say /buyvip", "VipBuy");
register_clcmd("say_team /buyvip", "VipBuy");

register_clcmd("say /respawn","call_respawn");

set_task(60.0,"VIP_msg",0,"",0,"b",0)

register_event("HLTV", "event_new_round", "a", "1=0", "2=0")


     
       xPut = CreateMultiForward("vip_putinserver", ET_IGNORE, FP_CELL);
       xSpawn = CreateMultiForward("vip_spawn", ET_IGNORE, FP_CELL);
       xKill = CreateMultiForward("vip_kill", ET_IGNORE, FP_CELL);
       xDie = CreateMultiForward("vip_die", ET_IGNORE, FP_CELL);
       xdisc = CreateMultiForward("vip_disconnect", ET_IGNORE, FP_CELL);
       xscan = CreateMultiForward("vip_think", ET_IGNORE, FP_CELL);
       xcon = CreateMultiForward("vip_connect", ET_IGNORE, FP_CELL);
       xinfo = CreateMultiForward("vip_infochanged", ET_IGNORE, FP_CELL);
       
       
register_forward(FM_PlayerPreThink, "PlayerIsThink");

respawn_cvar = register_cvar("vip_respawn","2")

}

public plugin_natives()
{

       register_library("vip_api");
       register_native("get_user_vip", "native_get_vip", 1)
       register_native("set_user_vip", "native_set_vip", 1)
}

public native_get_vip(id)
{
       if(!is_user_valid(id))
               return -1;
       
       return g_vip[id];
}


public native_set_vip(id, value)
{
       if(!is_user_valid(id))
               return false;
       
       if(value)
               g_vip[id] = true
       else
               g_vip[id] = false
       
       return true;
}


public HookKilledVip(victim,attacker,shouldgib)
{
       if(is_user_vip(victim) && !is_user_alive(victim))
       {
               new ret;
               ExecuteForward(xDie, ret, victim)
       }
       
       
       if(is_user_vip(attacker) && is_user_alive(attacker))
       {
               new xret;
               ExecuteForward(xKill, xret, attacker)
       }
}

public PlayerIsThink(id)
{
       if(is_user_vip(id))
       {
               new ret;
               ExecuteForward(xscan, ret, id);
       }
}

public call_respawn(id)
{
if(!is_user_alive(id))
{
if(mespawn[id] <= get_pcvar_num(respawn_cvar))
{
if(is_user_vip(id))
{
ExecuteHam(Ham_CS_RoundRespawn, id);
ColorChat(0 ,TEAM_COLOR ,"^1[ ^4%s^1 ] Ai primit respawn !",PLUGIN);
mespawn[id] = false;
new ret;
                ExecuteForward(xSpawn, ret, id)
return PLUGIN_HANDLED


}else{

ColorChat(0 ,TEAM_COLOR, "^1[ ^4%s^1 ] Nu esti vip !",PLUGIN);
return PLUGIN_HANDLED
}

}else{
ColorChat(0 ,TEAM_COLOR ,"^1[ ^4%s^1 ] Deja ai folosit aceasta comanda !",PLUGIN);
return PLUGIN_HANDLED
}

}else{
ColorChat(0 ,TEAM_COLOR ,"^1[ ^4%s^1 ] Deja esti viu !",PLUGIN);
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}

public event_new_round()
{
new Players[32]
new playerCount, i, player
get_players(Players, playerCount, "b")
for (i=0; i<playerCount; i++)
player = Players[i]
mespawn[player] = 0;
}

public VIP_msg(id)
{
ColorChat(0 ,TEAM_COLOR, "^1[ ^4%s^1 ] Pentru a vedea beneficiile vip tasteaza /buyvip",PLUGIN);
}

public VipBuy(id)
{
show_motd(id,"addons/amxmodx/configs/buyvip.html");
}

public Vips_Online(id)
{        
new iPlayers[ 32 ], iNum, iPlayerId, szName[ 32 ]
get_players( iPlayers, iNum, "ch" )

new iLen, szMessage[ ( sizeof iPlayers ) * charsmax( szName ) ]

iLen = formatex( szMessage, charsmax( szMessage ), "^1[ ^3VIP-uri Online ^1] : " )
for( new i; i < iNum; i++ )
{
iPlayerId = iPlayers[ i ]
if( is_user_vip( iPlayerId ) )
{
get_user_name( iPlayerId, szName, 31 )
iLen += formatex( szMessage[ iLen ], charsmax( szMessage ) - iLen, " ^3%s%s", szName, iLen ? "^1," : "" )
}
}
ColorChat( id, TEAM_COLOR,  szMessage )
return PLUGIN_HANDLED
}

public client_putinserver(id)
{
if (!ArraySize(g_Stroke))
{
return PLUGIN_CONTINUE;
}

static Stroke[64], Size = 0;

new name[35]
get_user_name(id, name, 34);


for (Size = 0; Size < ArraySize(g_Stroke); Size++)
{
ArrayGetString(g_Stroke, Size, Stroke, charsmax(Stroke));

if (equal(name, Stroke))
{
set_user_vip(id);
new ret;
                ExecuteForward(xPut, ret, id)

return PLUGIN_HANDLED;
}
}

return PLUGIN_CONTINUE;
}

public client_connect(id)
{
       if(is_user_vip(id))
       {
               new ret;
               ExecuteForward(xcon, ret, id)
               IsVip[id] = false;
       }
}

public client_disconnect(id)
{
       if(is_user_vip(id))
       {
               new ret;
               ExecuteForward(xdisc, ret, id)
               IsVip[id] = false;
       }
       remove_user_vip(id);
}


public Hook_Vip_Spawn(id)
{
if(is_user_vip(id))
{

set_task(1.0, "iScoreBoard", id + 6969)
new ret;
               ExecuteForward(xSpawn, ret, id)
}
VipUse[id] = true;
SpeedOn[id] = false;
}

public iScoreBoard(tID) {

new id = tID - 6969;

message_begin(MSG_ALL, get_user_msgid("ScoreAttrib"));
write_byte(id);
write_byte(4);
message_end();
}

public CurrentWeapon ( id )
{
if(is_user_alive(id) && SpeedOn[id] && is_user_vip(id))
set_user_maxspeed( id, get_user_maxspeed(id) + 50.0 );
}

public VipMenu(id)
{
if(is_user_alive(id))
{
if(VipUse[id])
{
if(is_user_vip(id))
{
ShowMenu(id);
return PLUGIN_HANDLED
}else{
ColorChat(0 ,TEAM_COLOR ,"^1[ ^4%s^1 ] Nu esti vip!",PLUGIN);
return PLUGIN_HANDLED
}
}else{

ColorChat(0 ,TEAM_COLOR ,"^1[ ^4%s^1 ] Deja ai folosit vip menu !",PLUGIN);
return PLUGIN_HANDLED
}
}else{
ColorChat(0 ,TEAM_COLOR ,"^1[ ^4%s^1 ] Trebuie sa fii in viata ca sa folosesti vip-menu !",PLUGIN);
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}

public client_infochanged(id)
{
       if(is_user_vip(id))
       {
               new ret;
               ExecuteForward(xinfo, ret, id)
               IsVip[id] = false;
       }
}


public ShowMenu ( id ) {  

new menu = menu_create ( "VIP Menu:", "MenuGiver" );

menu_additem ( menu, " Packet 10 HE !", "1", ADMIN_ALL );
menu_additem ( menu, " Gravitatie !", "2", ADMIN_ALL );
menu_additem ( menu, " Super Viteza", "3", ADMIN_ALL );
menu_additem ( menu, " Awp", "4", ADMIN_ALL );
menu_additem ( menu, " M4a1","5", ADMIN_ALL );
menu_additem ( menu, " 50 Health", "6", ADMIN_ALL );
menu_additem ( menu, " Deagle", "7", ADMIN_ALL );
menu_additem ( menu, " Ak47", "8", ADMIN_ALL );
menu_additem ( menu, " 5000 $", "9", ADMIN_ALL );

menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
menu_display ( id, menu, 0 );

return 1;
}

public MenuGiver ( id, menu, item ) {

if ( item == MENU_EXIT )
{
return 1;
}

new data [ 6 ], szName [ 64 ];
new access, callback;
new g_Name[33];
get_user_name(id, g_Name, 32);
menu_item_getinfo ( menu, item, access, data,charsmax ( data ), szName,charsmax ( szName ), callback );
new key = str_to_num ( data );

switch ( key )
{
case 1:
{
give_item(id, "weapon_hegrenade");
cs_set_user_bpammo( id, CSW_HEGRENADE, 10 )
ColorChat(0 ,TEAM_COLOR, "^1[ ^4%s^1 ] Jucatorul ^3%s^1 a ales din meniul de vip : ^4HE-PACHET",PLUGIN,g_Name);
VipUse[id] = false;
}

case 2:
{
set_user_gravity(id, 0.7);
ColorChat(0 ,TEAM_COLOR, "^1[ ^4%s^1 ] Jucatorul ^3%s^1 a ales din meniul de vip : ^4GRAVITATIE",PLUGIN,g_Name);
VipUse[id] = false;
}

case 3:
{
ColorChat(0 ,TEAM_COLOR, "^1[ ^4%s^1 ] Jucatorul ^3%s^1 a ales din meniul de vip : ^4VITEZA",PLUGIN,g_Name);
set_user_maxspeed( id, get_user_maxspeed(id) + 50.0 );
SpeedOn[id] = true;
VipUse[id] = false;
}

case 4:
{
give_item(id, "weapon_awp");
cs_set_user_bpammo(id, CSW_AWP, 1000);
ColorChat(0 ,TEAM_COLOR ,"^1[ ^4%s^1 ] Jucatorul ^3%s^1 a ales din meniul de vip : ^4AWP",PLUGIN,g_Name);
VipUse[id] = false;
}

case 5:
{
give_item(id, "weapon_m4a1");
cs_set_user_bpammo(id, CSW_M4A1, 1000);
ColorChat(0 ,TEAM_COLOR ,"^1[ ^4%s^1 ] Jucatorul ^3%s^1 a ales din meniul de vip : ^4m4a1",PLUGIN,g_Name);
VipUse[id] = false;
}

case 6:
{
set_user_health(id, get_user_health(id) + 50);
ColorChat(0 ,TEAM_COLOR ,"^1[ ^4%s^1 ] Jucatorul ^3%s^1 a ales din meniul de vip : ^4 +50HP",PLUGIN,g_Name);
VipUse[id] = false;
}

case 7:
{
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_DEAGLE, 1000);
ColorChat(0 ,TEAM_COLOR ,"^1[ ^4%s^1 ] Jucatorul ^3%s^1 a ales din meniul de vip : ^4DEAGLE",PLUGIN,g_Name);
VipUse[id] = false;
}

case 8:
{
give_item(id, "weapon_ak47");
cs_set_user_bpammo(id, CSW_AK47, 1000);
ColorChat(0 ,TEAM_COLOR ,"^1[ ^4%s^1 ] Jucatorul ^3%s^1 a ales din meniul de vip : ^4Ak47",PLUGIN,g_Name);
VipUse[id] = false;
}
case 9:
{
cs_set_user_money(id, cs_get_user_money(id) + 5000);
ColorChat(0 ,TEAM_COLOR ,"^1[ ^4%s^1 ] Jucatorul ^3%s^1 a ales din meniul de vip :^4 5000 $",PLUGIN,g_Name);
VipUse[id] = false;
}



}

menu_destroy ( menu );
return 1;

}

public plugin_cfg()
{
static File = 0, Buffer[64], Location[256];

g_Stroke = ArrayCreate(64 /* maximum length */);

get_localinfo("amxx_configsdir", Location, charsmax(Location));

add(Location, charsmax(Location), "/vips.ini ");

if (!file_exists(Location))
{
File = fopen(Location, "w+" /* write file */);

if (File)
{
fclose(File);
}
}

File = fopen(Location, "rt" /* read file as text */);

if (File)
{
while (!feof(File))
{
fgets(File, Buffer, charsmax(Buffer));

trim(Buffer);

if (!strlen(Buffer) || Buffer[0] == ';')
{
continue;
}

ArrayPushString(g_Stroke, Buffer);
}

fclose(File);
}
}

ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
new message[256];

switch(type)
{
case NORMAL: // clients scr_concolor cvar color
{
message[0] = 0x01;
}
case GREEN: // Green
{
message[0] = 0x04;
}
default: // White, Red, Blue
{
message[0] = 0x03;
}
}

vformat(message[1], 251, msg, 4);

// Make sure message is not longer than 192 character. Will crash the server.
message[191] = '^0';

new team, ColorChange, index, MSG_Type;
if(id)
{
MSG_Type = MSG_ONE;
index = id;
} else {
index = FindPlayer();
MSG_Type = MSG_ALL;
}

team = get_user_team(index);
ColorChange = ColorSelection(index, MSG_Type, type);


ShowColorMessage(index, MSG_Type, message);
if(ColorChange)
{
Team_Info(index, MSG_Type, TeamName[team]);
}
}

ShowColorMessage(id, type, message[])
{
static get_user_msgid_saytext;
if(!get_user_msgid_saytext)
{
get_user_msgid_saytext = get_user_msgid("SayText");
}
message_begin(type, get_user_msgid_saytext, _, id);
write_byte(id)
write_string(message);
message_end();
}

Team_Info(id, type, team[])
{
static bool:teaminfo_used;
static get_user_msgid_teaminfo;
if(!teaminfo_used)
{
get_user_msgid_teaminfo = get_user_msgid("TeamInfo");
teaminfo_used = true;
}
message_begin(type, get_user_msgid_teaminfo, _, id);
write_byte(id);
write_string(team);
message_end();

return 1;
}

ColorSelection(index, type, Color:Type)
{
switch(Type)
{
case RED:
{
return Team_Info(index, type, TeamName[1]);
}
case BLUE:
{
return Team_Info(index, type, TeamName[2]);
}
case GREY:
{
return Team_Info(index, type, TeamName[0]);
}
}

return 0;
}

FindPlayer()
{
new i = -1;
static iMaxPlayers;
if( !iMaxPlayers )
{
iMaxPlayers = get_maxplayers( );
}
while(i <= iMaxPlayers)
{
if(is_user_connected(++i))
return i;
}

return -1;
}

DarkArms
Founders
Founders

Mesaje : 226
Data de inscriere : 23/09/2016
Varsta : 17
Localizare : Terra

http://lowgamers.forumgratuit.ro

Sus In jos

descarca Re: VIP 1.9 UPDATE !

Mesaj Scris de Dracu la data de Lun Noi 14, 2016 10:43 pm

Good Job!
avatar
Dracu
Moderators
Moderators

Mesaje : 193
Data de inscriere : 11/11/2016

Sus In jos

descarca Re: VIP 1.9 UPDATE !

Mesaj Scris de Tipu la data de Mier Noi 23, 2016 1:26 pm

Good Job!
avatar
Tipu
Administrators
Administrators

Mesaje : 151
Data de inscriere : 22/11/2016

Sus In jos

descarca Re: VIP 1.9 UPDATE !

Mesaj Scris de CelRau la data de Dum Noi 27, 2016 7:53 pm

Good Job!
avatar
CelRau
Registered user
Registered user

Mesaje : 184
Data de inscriere : 26/11/2016

Sus In jos

descarca Re: VIP 1.9 UPDATE !

Mesaj Scris de Continut sponsorizat


Continut sponsorizat


Sus In jos

Sus

- Subiecte similare

 
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum