PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <fun>
#include <cstrike>
#include <fakemeta_util>
#include <hamsandwich>
#include <colorchat>
#include <engine>
native g_jump(id)
#pragma tabsize 0
#define PLUGIN "dr"
#define VERSION "3.2"
#define AUTHOR "ss"
#define is_valid_player(%1) (1 <= %1 <= 32)
new g_level[32], g_level_data, g_frags_level, g_ScreenFade
new g_level_max, g_level_num, g_levels[32]
new level_exp[32], g_aim_info, buffer[32]
new g_level_exp[32], g_Players, nameid[32], g_points[32]
new g_trime[32], g_MsgSync, gGrads[32]
new sound_level_up[] = { "Level_Up.wav"}
const PEV_SPEC_TARGET = pev_iuser2
new g_iTarget [33];
new g_Lifes[33];
public plugin_precache()
{
precache_sound( sound_level_up )
}
public plugin_init()
{
g_frags_level = register_cvar("zp_level_frags", "10")
g_level_max = register_cvar("zp_level_max", "150")
g_aim_info = register_cvar("xp_aim_info", "1")
g_level_num = register_cvar("zp_level_number", "1")
register_clcmd("say /shop", "Shop_Items")
register_clcmd("say shop", "Shop_Items")
register_clcmd("say donate", "Donate_Menu" );
register_clcmd("say /donate", "Donate_Menu" );
register_clcmd("say /showpoint", "ShowPoints" );
register_clcmd("say /mypoints", "cmd_showgolds" );
register_concmd("ms_point_", "cmd_set", ADMIN_IMMUNITY, "<name> <points> - set points to a player" );
register_concmd("rs_point_", "cmd_reset", ADMIN_IMMUNITY, "<name> <points> - reset player points" );
register_concmd("gamble", "CmdGamble", _, "usage: gamble <cash>")
g_level_data = nvault_open("Leveling_Save")
register_event("HLTV", "Round_Start", "a", "1=0", "2=0")
register_event("DeathMsg", "Frags_Manager", "a", "1>0")
register_event("DeathMsg", "eDeath", "a")
g_ScreenFade = get_user_msgid( "ScreenFade" )
register_event("StatusValue","show_status","b e","1=2","2!0")
register_event("StatusValue","hide_status","b e","1=1","2=0")
g_Players =get_maxplayers()
register_plugin(PLUGIN, VERSION, AUTHOR)
g_MsgSync = CreateHudSyncObj()
}
public plugin_natives() {
register_native("get_user_points", "native_get_user_points", 1);
register_native("set_user_points", "native_set_user_points", 1);
}
public native_get_user_points(id)
{
return g_points[id];
}
public native_set_user_points(id, amount)
{
g_points[id] = amount;
}
new const Grads[][] =
{
"Noob",
"Noob",
"Noob",
"Noob",
"Noob",
"Noob",
"Noob",
"Noob",
"Noob",
"Noob",
"Regular",
"Regular",
"Regular",
"Regular",
"Regular",
"Regular",
"Regular",
"Regular",
"Regular",
"Regular",
"Regular",
"Bhopper",
"Bhopper",
"Bhopper",
"Bhopper",
"Bhopper",
"Bhopper",
"Bhopper",
"Bhopper",
"Bhopper",
"Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Super Bhopper",
"Enemy Killer"
}
public Round_Start()
{
for(new id=1;id<=g_Players;id++)
set_task(3.0, "Level", id)
}
public Level(id)
{
if(is_user_alive(id) )
{
g_trime[id] = false;
new n = 1;
while( n < g_level[id] )
{
n = n + 1
}
}
}
public client_putinserver(id)
{
if(!is_user_bot(id) && is_valid_player(id))
Level_Load(id)
g_level_exp[id] = get_pcvar_num(g_frags_level)
new name[32]
g_trime[id] = false;
nameid[id] = get_user_name(id, name, sizeof name - 1)
if(is_user_alive(id))
{
g_trime[id] = false;
new n = 1;
while( n != g_level[id] )
{
n = n + 1;
}
}
if( g_level[id] == 0) g_level[id] = 1;
if( level_exp[id] == g_level[id] ) level_exp[id] = 0;
if(g_level[id] < get_pcvar_num(g_level_num))
g_levels[id] = get_pcvar_num(g_level_num);
else
{
if(g_level[id] != g_levels[id])
{
new x = 1;
while( g_level[id] > ( x * get_pcvar_num(g_level_num)) )
{
x = x + 1;
g_levels[id] = x * get_pcvar_num(g_level_num);
}
}
}
new y = 1;
while( g_level[id] != y )
{
y = y + 1;
g_level_exp[id] = y * get_pcvar_num(g_frags_level);
}
}
public hide_status(id)
{
set_hudmessage(0,0,0,0.0,0.0,0, 0.0, 0.01, 0.0, 0.0, 4)
show_hudmessage(id,"")
}
public show_status(id)
{
new name[32],pid = read_data(2)
get_user_name(pid,name,31)
switch(get_user_team(pid))
{
case 1: copy(buffer, 31, "Terrorist")
case 2: copy(buffer, 31, "Counter-Terrorist")
}
if(get_pcvar_num(g_aim_info) == 1)
{
set_hudmessage(random_num(200,150),random_num (100,50),random_num(50,25),-1.0,0.60,1, 0.01, 4.0, 0.01, 0.01, 4)
show_hudmessage(id, "%s^n[ Health : %d | Team : %s ]^n[ Grade : %s | Level : %i | Exp : %i/%i | Dr.Points : %d ]",name, get_user_health(pid), buffer, Grads[gGrads[pid]], g_level[pid], level_exp[pid], g_level_exp[pid], g_points[pid])
}
}
public eDeath()
{
new attacker = read_data(1)
new victim = read_data(2)
new headshot = read_data(3)
if(get_user_team(attacker) != get_user_team(victim))
{
g_points[attacker] += 1
}
else
{
if(attacker == victim)
{
g_points[attacker] += 0
}
else
{
if(!headshot)
g_points[attacker] += 2
else
g_points[attacker] += 2
}
}
}
public client_disconnect(id)
{
{
new name[32], player_nick[32]
player_nick[id] = get_user_name(id, name, sizeof name - 1)
if(player_nick[id] == nameid[id])
Level_Save(id)
}
Level_Save(id)
g_trime[id] = false;
}
public level_status(id)
{
new Spec
Spec = pev(id, PEV_SPEC_TARGET)
new PlayerName[32]
get_user_name(Spec, PlayerName, 31)
switch(get_user_team(id))
{
case 1: copy(buffer, 31, "Terrorist")
case 2: copy(buffer, 31, "Counter-Terrorist")
}
if(is_user_alive(id))
{
set_hudmessage(10, 180, 10, -1.0, 0.87, 0, 6.0, 1.1)
ShowSyncHudMsg(id, g_MsgSync, "[ Health : %d | Team : %s ]^n[ Grade : %s | Level : %i | Exp : %i/%i | Dr.Points : %d ]",get_user_health(id), buffer, Grads[gGrads[id]], g_level[id], level_exp[id], g_level_exp[id], g_points[id])
}
else
switch(get_user_team(Spec))
{
case 1: copy(buffer, 31, "Terrorist")
case 2: copy(buffer, 31, "Counter-Terrorist")
}
if(is_user_alive(Spec))
{
set_hudmessage(200, 30, 200, -1.0, 0.79, 0, 6.0, 1.1)
ShowSyncHudMsg(id, g_MsgSync, "Spectating: %s ^n[ Health : %d | Team : %s ]^n[ Grade : %s | Level : %i | Exp : %i/%i | Dr.Points : %d ]",PlayerName, get_user_health(Spec), buffer, Grads[gGrads[id]], g_level[Spec], level_exp[Spec], g_level_exp[Spec], g_points[Spec])
}
}
public Level_Save(id)
{
new vaultkey[64], vaultdata[256]
new AuthID[35]
get_user_name(id,AuthID,34)
format(vaultkey, 63, "%s-/", AuthID)
format(vaultdata, 255, "%i# %i# %d# %s#", g_level[id], level_exp[id], g_points[id], gGrads[id])
nvault_set(g_level_data, vaultkey, vaultdata)
return PLUGIN_CONTINUE;
}
public Level_Load(id)
{
new vaultkey[64], vaultdata[256]
new AuthID[35]
get_user_name(id,AuthID,34)
format(vaultkey, 63, "%s-/", AuthID)
format(vaultdata, 255, "%i# %i# %d# %s#", g_level[id], level_exp[id], g_points[id], gGrads[id])
nvault_get(g_level_data, vaultkey, vaultdata, 255)
replace_all(vaultdata, 255, "#", " ")
new givelevel[32], givexp[32], givepoints[32], givegrads[32]
parse(vaultdata, givelevel, 31, givexp, charsmax(givexp), givepoints, charsmax(givepoints), givegrads, charsmax(givegrads))
g_level[id] = str_to_num(givelevel)
level_exp[id] = str_to_num(givexp)
g_points[id] = str_to_num(givepoints)
set_task(1.0 ,"level_status", id, _, _, "b")
return PLUGIN_CONTINUE;
}
public Frags_Manager()
{
new aname[32], attacker; attacker = read_data(1)
new y; y = 1;
get_user_name(attacker, aname, sizeof aname - 1)
if( ( level_exp[attacker] >= (g_level_exp[attacker] - 1) ) && (g_level[attacker] <= get_pcvar_num(g_level_max)) && is_user_alive(attacker) )
{
g_level[attacker] = g_level[attacker] + 1;
level_exp[attacker] = 0;
while( g_level[attacker] != y )
{
y = y + 1;
g_level_exp[attacker] = y * get_pcvar_num(g_frags_level);
}
message_begin(MSG_ONE_UNRELIABLE, g_ScreenFade, _, attacker)
write_short(1<<12) // duration
write_short(1) // hold time
write_short(0x0000) // fade type
write_byte(1) // red
write_byte(200) // green
write_byte(0) // blue
write_byte(205) // alpha
message_end()
emit_sound(attacker, CHAN_STREAM, sound_level_up, 1.0, ATTN_NORM, 0, PITCH_HIGH )
set_hudmessage(0, 200, 0, 0.65, 0.5, 0, 0.0, 3.0, 2.0, 1.0, -1)
show_hudmessage(0, "%s Has Cut Down %i Level", aname, g_level[attacker])
Level_Save(attacker);
}
else
{
if(g_level[attacker] == get_pcvar_num(g_level_max))
ColorChat(attacker,GREEN,"[MS] ^1You have reached the maximum Level: ^4%i", g_level[attacker])
level_exp[attacker] = level_exp[attacker] + 1;
Level_Save(attacker);
}
}
public Shop_Items(iPlayer)
{
new szText[555 char]
formatex(szText, charsmax(szText), "\r[MS] \yDeathRun Shop \d[\rYour Points : %d\d]^n^n", g_points[iPlayer])
new AdminMenu = menu_create(szText, "Dr_Shop")
formatex(szText, charsmax(szText), "%sRespawn \r[Only Dead] \y[5 Dr-Points]", g_points[iPlayer] >= 2 ? "\w":"\d")
menu_additem(AdminMenu, szText, "1", 0)
formatex(szText, charsmax(szText), "%sInvisibility \r[10 Seconds] \y[15 Dr-Points]", g_points[iPlayer] >= 15 ? "\w":"\d")
menu_additem(AdminMenu, szText, "2", 0)
formatex(szText, charsmax(szText), "%sHealth \r[100 Health] \y[5 Dr-Points]", g_points[iPlayer] >= 5 ? "\w":"\d")
menu_additem(AdminMenu, szText, "3", 0)
formatex(szText, charsmax(szText), "%sFlash Bang \r[] \y[4 Dr-Points]", g_points[iPlayer] >= 4 ? "\w":"\d")
menu_additem(AdminMenu, szText, "4", 0)
formatex(szText, charsmax(szText), "%sSmoke Grenade \r[] \y[4 Dr-Points]", g_points[iPlayer] >= 4 ? "\w":"\d")
menu_additem(AdminMenu, szText, "5", 0)
formatex(szText, charsmax(szText), "%sHe Grenade \r[] \y[4 Dr-Points]", g_points[iPlayer] >= 4 ? "\w":"\d")
menu_additem(AdminMenu, szText, "6", 0)
formatex(szText, charsmax(szText), "%sMultiJump \r[+1 Jump] \y[6 Dr-Points]", g_points[iPlayer] >= 6 ? "\w":"\d")
menu_additem(AdminMenu, szText, "7", 0)
formatex(szText, charsmax(szText), "%sDesert Eagle \r[7 Bullets] \y[70 Dr-Points]", g_points[iPlayer] >= 70 ? "\w":"\d")
menu_additem(AdminMenu, szText, "8", 0)
formatex(szText, charsmax(szText), "%sImmortality \r[10 Seconds] \y[40 Dr-Points]", g_points[iPlayer] >= 40 ? "\w":"\d")
menu_additem(AdminMenu, szText, "9", 0)
formatex(szText, charsmax(szText), "%sNoclip \r[2 Seconds] \y[100 Dr-Points]", g_points[iPlayer] >= 100 ? "\w":"\d")
menu_additem(AdminMenu, szText, "10", 0)
formatex(szText, charsmax(szText), "%sGlow \r[Random Glow] \y[8 Dr-Points]", g_points[iPlayer] >= 8 ? "\w":"\d")
menu_additem(AdminMenu, szText, "11", 0)
menu_setprop(AdminMenu, MPROP_EXIT, MEXIT_ALL)
menu_display(iPlayer, AdminMenu, 0)
return PLUGIN_HANDLED
}
public Set_p(id)
{
g_points[id] += 6000
g_Lifes[id] += 600
}
public Dr_Shop(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED
}
new data[6], iName[64], access, callback
menu_item_getinfo(menu, item, access, data, charsmax(data), iName, charsmax(iName), callback )
new key = str_to_num(data)
switch(key)
{
case 1:
{
if( g_points[id] < 2 )
{
ColorChat(id,GREEN,"^4[MS] ^1You don't have enough ^4Points^1 to buy ^3Respawn")
return PLUGIN_HANDLED
}
if( is_user_alive ( id ))
{
ColorChat(id ,GREEN, "^4[MS] ^1Only Dead people can purchase ^3Respawn ^1ability" )
return PLUGIN_HANDLED
}
else
if( g_points[id] >= 4 )
ColorChat(id,GREEN,"^4[MS] ^1You bought ^3Respawn ^1ability")
ExecuteHamB(Ham_CS_RoundRespawn, id)
g_points[id] -= 2
}
case 2:
{
if( g_points[id] < 15 )
{
ColorChat(id,GREEN,"^4[MS] ^1You don't have enough ^4Points^1 to buy ^3Invisibility")
return PLUGIN_HANDLED
}
if (!is_user_alive ( id ))
{
ColorChat(id ,GREEN, "^4[MS] ^1Only Alive people can purchase ^3Invisibility" )
return PLUGIN_HANDLED
}
else
if( g_points[id] >= 15 )
ColorChat(id,GREEN,"^4[MS] ^1You Bought ^3Invisibility ^1For^4 10 Seconds")
g_points[id] -= 15
set_user_footsteps(id, 1)
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha , 0)
set_user_maxspeed(id,get_user_maxspeed(id) + 500)
set_task(10.0, "Set_Invi",id);
}
case 3:
{
if( g_points[id] < 5 )
{
ColorChat(id,GREEN,"^4[MS] ^1You don't have enough ^4Points^1 to buy^3 100 Health")
return PLUGIN_HANDLED
}
if (!is_user_alive ( id ))
{
ColorChat(id ,GREEN, "^4[MS] ^1Only Alive people can purchase^3 100 Health" )
return PLUGIN_HANDLED
}
else
if( g_points[id] >= 5 )
ColorChat(id,GREEN,"[MS] ^1You Bought^4 100 ^1Health")
g_points[id] -= 5
set_user_health(id, get_user_health(id) + 100)
}
case 4:
{
if( g_points[id] < 4 )
{
ColorChat(id,GREEN,"^4[MS] ^1You don't have enough ^4Points^1 to buy ^3Flash Bang")
return PLUGIN_HANDLED
}
if (!is_user_alive ( id ))
{
ColorChat(id ,GREEN, "^4[MS] ^1Only Alive people can purchase ^3Flash Bang" )
return PLUGIN_HANDLED
}
else
if( g_points[id] >= 4 )
ColorChat(id,GREEN,"[MS] ^1You Bought^4 Flashbang")
g_points[id] -= 4
give_item (id,"weapon_flashbang")
cs_set_user_bpammo(id, CSW_FLASHBANG, cs_get_user_bpammo(id, CSW_FLASHBANG) + 1)
}
case 5:
{
if( g_points[id] < 4 )
{
ColorChat(id,GREEN,"^4[MS] ^1You don't have enough ^4Points^1 to buy ^3Smoke Grenade")
return PLUGIN_HANDLED
}
if (!is_user_alive ( id ))
{
ColorChat(id ,GREEN, "^4[MS] ^1Only Alive people can purchase ^3Smoke Grenade" )
return PLUGIN_HANDLED
}
else
if( g_points[id] >= 4 )
ColorChat(id,GREEN,"[MS] ^1You Bought^4 Smoke grenade")
g_points[id] -= 4
give_item (id,"weapon_smokegrenade")
cs_set_user_bpammo(id, CSW_SMOKEGRENADE, cs_get_user_bpammo(id, CSW_SMOKEGRENADE) + 1)
}
case 6:
{
if( g_points[id] < 4 )
{
ColorChat(id,GREEN,"^4[MS] ^1You don't have enough ^4Points^1 to buy ^3He Grenade")
return PLUGIN_HANDLED
}
if (!is_user_alive ( id ))
{
ColorChat(id ,GREEN, "^4[MS] ^1Only Alive people can purchase ^3He Grenade" )
return PLUGIN_HANDLED
}
else
if( g_points[id] >= 4 )
ColorChat(id,GREEN,"[MS] ^1You Bought^4 He Grenade")
g_points[id] -= 4
give_item (id,"weapon_hegrenade")
cs_set_user_bpammo(id, CSW_HEGRENADE, cs_get_user_bpammo(id, CSW_HEGRENADE) + 1)
}
case 7:
{
if( g_points[id] < 6 )
{
ColorChat(id,GREEN,"^4[MS] ^1You don't have enough ^4Points^1 to buy ^3Multijump")
return PLUGIN_HANDLED
}
if (!is_user_alive ( id ))
{
ColorChat(id ,GREEN, "^4[MS] ^1Only Alive people can purchase ^3 Multijump x1" )
return PLUGIN_HANDLED
}
else
if( g_points[id] >= 6 )
ColorChat(id,GREEN,"[MS] ^1You Bought ^3Multijump x1")
g_points[id] -= 6
g_jump(id)
}
case 8:
{
if( g_points[id] < 70 )
{
ColorChat(id,GREEN,"^4[MS] ^1You don't have enough ^4Points^1 to buy ^3Deagle")
return PLUGIN_HANDLED
}
if (!is_user_alive ( id ))
{
ColorChat(id ,GREEN, "^4[MS] ^1Only Alive people can purchase ^3Deagle" )
return PLUGIN_HANDLED
}
else
if( g_points[id] >= 70 )
ColorChat(id,GREEN,"^4[MS] ^1You Bought ^3Desert-Eagle")
g_points[id] -=8
give_item( id, "weapon_deagle" )
}
case 9:
{
if( g_points[id] < 40 )
{
ColorChat(id,GREEN,"^4[MS] ^1You don't have enough ^4Points^1 to buy ^3Immortality")
return PLUGIN_HANDLED
}
if (!is_user_alive ( id ))
{
ColorChat(id ,GREEN, "^4[MS] ^1Only Alive people can purchase ^3Immortality" )
return PLUGIN_HANDLED
}
else
if( g_points[id] >= 40 )
ColorChat(id,GREEN,"^4[MS] ^1You Bought ^3Immortality ^1For^4 10 Seconds")
g_points[id] -= 40
set_user_godmode(id, 1)
set_task(10.0, "immort", id)
}
case 10:
{
if( g_points[id] < 100 )
{
ColorChat(id,GREEN,"^4[MS] ^1You don't have enough ^4Points^1 to buy ^3Noclip")
return PLUGIN_HANDLED
}
if (!is_user_alive ( id ))
{
ColorChat(id ,GREEN, "^4[MS] ^1Only Alive people can purchase ^3Noclip" )
return PLUGIN_HANDLED
}
else
if( g_points[id] >= 100 )
ColorChat(id,GREEN,"^4[MS] ^1You Bought ^3Noclip ^1For^4 2 Seconds")
g_points[id] -= 100
set_user_noclip(id, 1)
set_task(2.0, "noc", id)
}
case 11:
{
if( g_points[id] < 8 )
{
ColorChat(id,GREEN,"^4[MS] ^1You don't have enough ^4Points^1 to buy ^3Glow")
return PLUGIN_HANDLED
}
if (!is_user_alive ( id ))
{
ColorChat(id ,GREEN, "^4[MS] ^1Only Alive people can purchase ^3Glow" )
return PLUGIN_HANDLED
}
else
if( g_points[id] >= 8 )
ColorChat(id,GREEN,"^4[MS] ^1You Bought ^3Random Glow")
g_points[id] -= 8
set_user_rendering(id, kRenderFxGlowShell, random_num(0,255), random_num(0,255), random_num(0,255), kRenderNormal, 16 )
}
}
return PLUGIN_HANDLED
}
public Set_Invi(id)
{
ColorChat(id,GREEN,"^4[MS] ^3Invisibility ^1has been removed!")
set_user_footsteps(id, 0)
set_user_rendering(id, 0)
return PLUGIN_HANDLED
}
public ShowPoints(id)
{
static opcion[64]
formatex(opcion, charsmax(opcion),"\r[MS] \yShow Players Points :")
new iMenu = menu_create(opcion, "Handlegolds")
new players[32], pnum, tempid
new szName[32], szTempid[10]
get_players(players, pnum, "ch")
for( new i; i<pnum; i++ )
{
tempid = players[i]
get_user_name(tempid, szName, 31)
num_to_str(tempid, szTempid, 9)
formatex(opcion,127,"\w%s \d[ \r%i Points\d ]",szName, g_points[tempid]);
menu_additem(iMenu, opcion, szTempid, 0)
}
menu_display(id, iMenu)
return PLUGIN_HANDLED
}
public Handlegolds(id, menu, item)
{
if(item == MENU_EXIT)
{
return PLUGIN_HANDLED
}
new data[6], name[64]
new access, callback
menu_item_getinfo (menu, item, access, data, 5, name, 63, callback)
new tempid = str_to_num (data)
new szName[33], szPlayerName[33]
get_user_name(id, szName, 32)
get_user_name(tempid, szPlayerName, 32)
ColorChat(id, RED, "^4[MS] ^1Player ^3%s ^1has ^3%i ^4Drpoints ^1!",szPlayerName, g_points[tempid])
ShowPoints(id);
return PLUGIN_CONTINUE
}
public Donate_Menu(id)
{
new iMenu = menu_create("\r[MS] \yDonate Players Menu", "handleDonate");
new iPlayers[32], szName[32], szKey[3], iNum, iPlayer;
get_players(iPlayers, iNum,"ch");
for( new i; i < iNum; i++ )
{
iPlayer = iPlayers[i];
num_to_str(iPlayer, szKey, charsmax(szKey));
get_user_name(iPlayer, szName, charsmax(szName));
menu_additem(iMenu, szName, szKey);
}
menu_setprop(iMenu, MPROP_EXITNAME, "Back");
menu_display(id, iMenu, 0);
return 0;
}
public handleDonate(id, menu, item)
{
if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new szData[6], iAccess, iCallback;
menu_item_getinfo(menu, item, iAccess, szData, charsmax(szData), _, _, iCallback);
g_iTarget[id] = str_to_num(szData);
new szName[32];
get_user_name(g_iTarget[id], szName, charsmax(szName));
client_cmd(id, "messagemode Donate");
return PLUGIN_HANDLED;
}
public CmdDonate(id)
{
new szArg[5];
read_argv(1, szArg, charsmax(szArg));
new iValue = str_to_num(szArg);
if( iValue > g_points[id] )
{
ColorChat(id,GREEN, "^4[MS] ^1You only have ^3%i ^4Drpoints ^1!",g_points[id]);
return PLUGIN_HANDLED;
}
new iTarget = g_iTarget[id];
if( !iTarget )
{
return PLUGIN_HANDLED;
}
if( iTarget == id )
{
return PLUGIN_HANDLED;
}
g_points[id] -= iValue;
g_points[iTarget] += iValue;
new szName[2][32];
get_user_name(iTarget, szName[0], charsmax(szName[]));
get_user_name(id, szName[1], charsmax(szName[]));
ColorChat(id,GREEN, "^4[MS] ^1You donated ^3%i^4Drpoints ^1to ^3%s ^1!", iValue, szName[0]);
ColorChat(iTarget,GREEN, "^4[MS] ^3%s^1 sent you ^3%i ^4Drpoints", szName[1], iValue);
return PLUGIN_HANDLED;
}
public cmd_showgolds(id)
{
set_hudmessage(0, 255, 255, 0.0, 0.87, 0, 6.0, 12.0)
show_hudmessage(id, "You Have %d Points", g_points [id] )
ColorChat( id, GREEN, "^4[MS] ^1You have ^3%d ^4Drpoints ^1!", g_points[ id ] );
}
public cmd_set(id,level,cid)
{
if ( !(get_user_flags(id) & ADMIN_IMMUNITY) )
return PLUGIN_HANDLED
else
{
new target[32], pid
read_argv(1,target,31)
pid = cmd_target(id,target,2)
new amountstr[10], amount
read_argv(2,amountstr,9)
amount = str_to_num(amountstr)
new name[32], tname[32]
get_user_name(id,name,31)
get_user_name(pid,tname,31)
g_points[pid] += amount
ColorChat(id, GREEN, "^4[MS] ^1You sent ^3%d ^4Drpoints ^1to ^3%s ^1!", amount, tname)
ColorChat(pid, GREEN, "^4[MS] ^1Admin ^3%s ^1sent ^3%d ^4Drpoints ^1to you, Now you have ^3%d ^4Drpoints ^1!", name, amount,g_points[pid])
}
return PLUGIN_HANDLED
}
public cmd_reset(id,level,cid)
{
if ( !(get_user_flags(id) & ADMIN_IMMUNITY) )
return PLUGIN_HANDLED
else
{
new target[32], pid
read_argv(1,target,31)
pid = cmd_target(id,target,2)
new amountstr[10], amount
read_argv(2,amountstr,9)
amount = str_to_num(amountstr)
new name[32], tname[32]
get_user_name(id,name,31)
get_user_name(pid,tname,31)
if((g_points[pid] -= amount) < 0)
amount = g_points[pid]
g_points[pid] -= amount
ColorChat(id, GREEN, "^4[MS] ^1You removed ^3%d ^4Drpoints ^1from ^3%s ^1!", amount, tname)
ColorChat(pid, GREEN, "^4[MS] ^1Admin ^3%s ^1removed from you ^3%d ^4Drpoints ^4! ^1Now you have ^3%d ^4Drpoints ^1!", name, amount,g_points[pid])
}
return PLUGIN_HANDLED
}
public immort(id) {
if(is_user_alive(id))
{
set_user_godmode(id, 0)
ColorChat(id, GREEN, "^4[MS] ^3Immortality ^1has been removed!")
}
}
public noc(id) {
if(is_user_alive(id))
{
set_user_noclip(id, 0)
ColorChat(id, GREEN, "^4[MS] ^3Noclip ^1has been removed!")
}
}
public glow(id) {
if (!is_user_alive(id))
{
set_user_rendering( id, kRenderFxNone, 0, 0, 0, kRenderNormal, 0 )
}
}
public CmdGamble(id) {
new cash = native_get_user_points(id)
new szName[32]
if(cash < 10) {
console_print(id, "[MS][Gamble] You need at least 10 DrPoints to gamble.")
ColorChat(id,GREEN,"^4[MS][Gamble]^1 You need at least^4 10 ^3DrPoints^1 to gamble.")
return PLUGIN_HANDLED
}
else {
new argv[35], gamblecash
read_argv(1, argv, charsmax(argv))
gamblecash = str_to_num(argv)
if(gamblecash < 10) {
console_print(id, "[MS][Gamble] You need to gamble at least 10 Drpoints")
ColorChat(id,GREEN,"^4[MS][Gamble]^1 You need to gamble at least^4 10 ^3Drpoints")
return PLUGIN_HANDLED
}
if(cash < gamblecash) {
console_print(id, "[MS][Gamble] You only have %i Drpoints", cash)
ColorChat(id,GREEN, "^4[MS][Gamble]^1 You only have ^4%i^3Drpoints", cash)
return PLUGIN_HANDLED
}
new dice = random_num(1, 100)
if(dice > 52) {
native_set_user_points(id, cash += gamblecash)
console_print(id, "[MS][Gamble] Congratulations, you won a total of %i Drpoints", gamblecash)
console_print(id, "[MS][Gamble] You now have a total of %i", cash)
ColorChat(0,GREEN,"^4[MS][Gamble]^1 Player:^3%s^1 Gambled ^4%i ^1and won ^4%i ^1of ^3Drpoints ^1!!!",szName, gamblecash, cash)
}
else if(dice < 48) {
native_set_user_points(id, cash -= gamblecash)
console_print(id, "[MS][Gamble] Oh no... You lost %i cash", gamblecash)
console_print(id, "[MS][Gamble] You now have a total of %i", cash)
ColorChat(0,GREEN,"^4[MS][Gamble]^1 Player:^3%s^1 Gambled ^4%i ^1and lost ^4%i ^1of ^3Drpoints ^1!!!",szName, gamblecash, cash)
}
}
return PLUGIN_HANDLED
}