1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
60.
61.
62.
63.
64.
65.
66.
67.
68.
69.
70.
71.
72.
73.
74.
75.
76.
77.
78.
79.
80.
81.
82.
83.
84.
85.
86.
87.
88.
89.
90.
91.
92.
93.
94.
95.
96.
97.
98.
99.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
301.
302.
303.
304.
305.
306.
307.
308.
309.
310.
311.
312.
313.
314.
315.
316.
317.
318.
319.
320.
321.
322.
323.
324.
325.
326.
327.
328.
329.
330.
331.
332.
333.
334.
335.
336.
337.
338.
339.
340.
341.
342.
343.
344.
345.
346.
347.
348.
349.
350.
351.
352.
353.
354.
355.
356.
357.
358.
359.
360.
361.
362.
363.
364.
365.
366.
367.
368.
369.
370.
371.
372.
373.
374.
375.
376.
377.
378.
379.
380.
381.
382.
383.
384.
385.
386.
387.
388.
389.
390.
391.
392.
393.
394.
395.
396.
397.
398.
399.
400.
401.
402.
403.
404.
405.
406.
407.
408.
409.
410.
411.
412.
413.
414.
415.
416.
417.
418.
419.
420.
421.
422.
423.
424.
425.
426.
427.
428.
429.
430.
431.
432.
433.
434.
435.
436.
437.
438.
439.
440.
441.
442.
443.
444.
445.
446.
447.
448.
449.
450.
451.
452.
453.
454.
455.
456.
457.
458.
459.
460.
461.
462.
463.
464.
465.
466.
467.
468. | #include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <nvault>
#include <fakemeta>
#define PLUGIN "SURF XP MOD"
#define AUTHOR "Ardivaba"
#define VERSION "1.0"
#define TUTORIAL 1001
#define TASK_TUT 1111
#define MSOUND "items/nvg_off.wav"
enum { RED = 1, BLUE, YELLOW, GREEN }
new const g_TutorPrecache[][] = { "gfx/career/icon_!.tga", "gfx/career/icon_!-bigger.tga", "gfx/career/icon_i.tga", "gfx/career/icon_i-bigger.tga", "gfx/career/icon_skulls.tga", "gfx/career/round_corner_ne.tga", "gfx/career/round_corner_nw.tga", "gfx/career/round_corner_se.tga", "gfx/career/round_corner_sw.tga", "resource/TutorScheme.res", "resource/UI/TutorTextWindow.res" }
new g_MsgTutor
new g_MsgTutClose
new gCvarNozoom
new const LEVELS[200] =
{
50,100,200,400,600,800,1000,1200,1400,1600,1800,2000,2200,2400,2600,2800,3000,3200,3400,3600,
3800,4000,4200,4400,4600,4800,5000,5200,5400,5600,5800,6000,6200,6400,6600,6800,7000,7200,7400,
7600,7800,8000,8200,8400,8600,8800,9000,9200,9400,9600,9800,10000,10200,10400,10600,10800,11000,
11200,11400,11600,11800,12000,12200,12400,12600,12800,13000,13200,13400,13600,13800,14000,14200,
14400,14600,14800,15000,15200,15400,15600,15800,16000,16200,16400,16600,16800,17000,17200,17400,
17600,17800,18000,18200,18400,18600,18800,19000,19200,19400,19600,19800,20000,20200,20400,20600,
20800,21000,21200,21400,21600,21800,22000,22200,22400,22600,22800,23000,23200,23400,23600,23800,
24000,24200,24400,24600,24800,25000,25200,25400,25600,25800,26000,26200,26400,26600,26800,27000,
27200,27400,27600,27800,28000,28200,28400,28600,28800,29000,29200,29400,29600,29800,30000,30200,
30400,30600,30800,31000,31200,31400,31600,31800,32000,32200,32400,32600,32800,33000,33200,33400,
33600,33800,34000,34200,34400,34600,34800,35000,35200,35400,35600,35800,36000,36200,36400,36600,
36800,37000,37200,37400,37600,37800,38000,38200,38400,38600,38800,39000,39200,39400,39600
}
new PXP[ 33 ]
new PLEVEL[ 33 ]
new PKS[ 33 ]
new g_vault
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event( "DeathMsg", "EventDeathMsg", "a" )
register_clcmd( "say /xp", "printXp", -1, "Ile masz Expa" )
register_clcmd( "say /level", "printLevel", -1, "Jaki masz level" )
register_clcmd( "say /nowylevel", "printNewLevel", -1, "Ile musisz miec jeszcze expa do nastepnego levela" )
register_clcmd( "say /info", "printInfo", -1, "Wyswietla Info" )
register_clcmd( "say /bronie", "printWeapons", -1, "Info o Odblokowanych Broniach" )
register_event("SetFOV","zoom","b","1<90")
register_event("CurWeapon","ev_CurWeapon", "be", "1=1")
RegisterHam(Ham_Spawn, "player", "EventPlayerSpawn", 1)
RegisterHam(Ham_TakeDamage, "player", "fwHamTakeDamage")
g_vault = nvault_open("SURFXPMOD")
g_MsgTutor = get_user_msgid("TutorText")
g_MsgTutClose = get_user_msgid("TutorClose")
gCvarNozoom = register_cvar("sxm_nozoom", "0", 0, 0.0)
}
public plugin_precache()
{
precache_sound(MSOUND)
new i
for(i = 0; i < sizeof g_TutorPrecache; i++)
{
precache_generic(g_TutorPrecache[i])
}
precache_model("models/customs/v_knife.mdl")
precache_model("models/customs/v_gdeagle.mdl")
precache_model("models/customs/v_elite.mdl")
precache_model("models/customs/v_shegrenade.mdl")
precache_model("models/customs/v_glock18.mdl")
precache_model("models/customs/v_usp.mdl")
precache_model("models/customs/v_p90.mdl")
precache_model("models/customs/v_gail.mdl")
precache_model("models/customs/v_famas.mdl")
precache_model("models/customs/v_m249.mdl")
precache_model("models/customs/v_ak47.mdl")
precache_model("models/customs/v_mp5.mdl")
precache_model("models/customs/v_m4a1.mdl")
precache_model("models/customs/v_m3.mdl")
precache_model("models/customs/v_scout.mdl")
}
public client_connect( id )
{
PXP[ id ] = 0
LoadData( id )
}
public client_disconnect( id )
{
SaveData( id )
PXP[ id ] = 0
PLEVEL[ id ] = 0
PKS[ id ] = 0
}
public EventPlayerSpawn( id )
{
new health
new newhealth
new money
new newmoney
new armor
new newarmor
money = cs_get_user_money( id )
newmoney = money + (PLEVEL[ id ] * 100)
cs_set_user_money( id, newmoney)
if( PLEVEL[ id ] <= 25 )
{
health = get_user_health( id )
newhealth = health + (PLEVEL[ id ])
set_user_health( id, newhealth )
}
else
{
health = get_user_health( id )
newhealth = 125
armor = get_user_armor( id )
newarmor = armor + ((PLEVEL[ id ]) - 25)
set_user_armor( id, newarmor )
set_user_health( id, newhealth )
}
}
public EventDeathMsg()
{
new killer = read_data( 1 )
new victim = read_data( 2 )
new headshot = read_data( 3 )
new xp
new hs
if(PLEVEL[ killer ] > PLEVEL[ victim ])
{
xp = 4
}
if(PLEVEL[ killer ] < PLEVEL[ victim ])
{
xp = 6
}
if(PLEVEL[ killer ] == PLEVEL[ victim ])
{
xp = 5
}
PKS[ victim ] = 0
if( victim == killer )
{
return PLUGIN_CONTINUE
}
if(headshot)
{
xp = xp + 5
hs = 1
}
if(PKS[ killer ] < 10)
{
PKS[ killer ]++
}
xp = xp + PKS[ killer ]
add_xp( killer, xp, hs )
check_level( killer )
new Text[ 100 ]
formatex(Text,191,"Zginales i straciles swoj killstreak!")
MakeTutor(victim,Text,RED,3.0)
return PLUGIN_CONTINUE
}
public add_xp( id, xp, hs )
{
new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
PXP[ id ] = PXP[ id ] + xp
if(hs)
{
new Text[ 100 ]
formatex(Text,191,"Headshot! Dostales %d EXP'a! ^nKillstreak: %d^nNowy level za %d EXP'a!", xp, PKS[ id ], newlevel)
MakeTutor(id,Text,GREEN,3.0)
}
else
{
new Text[ 100 ]
formatex(Text,191,"Dostales %d EXP'a! ^nKillstreak: %d^nNowy level za %d EXP'a!", xp, PKS[ id ], newlevel)
MakeTutor(id,Text,GREEN,3.0)
}
}
public check_level( id )
{
if(PXP[ id ] >= LEVELS[PLEVEL[ id ]])
{
PLEVEL[ id ]++
new Text[ 100 ]
formatex(Text,191,"Osiagnoles nowy Level %d!", PLEVEL[ id ])
MakeTutor(id,Text,GREEN,5.0)
}
}
public printWeapons( id )
{
new Text[ 255 ]
formatex(Text,191,
"Odblokuj LEVEL 5 ^nA dostaniesz Zloty Noz^n^nOdblokuj LEVEL 7^nA dostaniesz Zlote Elites^n^nOdblokuj LEVEL 10^nA dostaniesz Zlote Deagle^n^nOdblokuj LEVEL 15^nA dostaniesz Niemiecki Granat")
MakeTutor(id,Text,YELLOW,7.0)
}
public printInfo( id )
{
new Text[ 255 ]
formatex(Text,191,
"Co to jest SURF XP MOD?^n-SXM jest modem stworzonym przez Ardivaba dla serwerow SURF^n^nCo mozna zdobyc za Levele?^n-Co level otrzymujesz HP, wiecej pieniedzy na start i zlote bronie.")
MakeTutor(id,Text,YELLOW,7.0)
}
public printXp( id )
{
new Text[ 100 ]
formatex(Text,191,"Posiadasz %d EXP'a!", PXP[ id ])
MakeTutor(id,Text,YELLOW,3.0)
}
public printNewLevel( id )
{
new newlevel = LEVELS[PLEVEL[ id ]]-PXP[ id ]
new Text[ 100 ]
formatex(Text,191,"Nowy level za %d EXP'a!", newlevel)
MakeTutor(id,Text,YELLOW,3.0)
}
public printLevel( id )
{
new Text[ 100 ]
formatex(Text,191,"Twoj Level: %d!", PLEVEL[ id ])
MakeTutor(id,Text,YELLOW,3.0)
}
public SaveData(id)
{
new AuthID[35]
get_user_name(id,AuthID,34)
new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s-Mod",AuthID)
format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
nvault_set(g_vault,vaultkey,vaultdata)
return PLUGIN_CONTINUE
}
public LoadData(id)
{
new AuthID[35]
get_user_name(id,AuthID,34)
new vaultkey[64],vaultdata[256]
format(vaultkey,63,"%s-Mod",AuthID)
format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
nvault_get(g_vault,vaultkey,vaultdata,255)
replace_all(vaultdata, 255, "#", " ")
new playerxp[32], playerlevel[32]
parse(vaultdata, playerxp, 31, playerlevel, 31)
PXP[id] = str_to_num(playerxp)
PLEVEL[id] = str_to_num(playerlevel)
return PLUGIN_CONTINUE
}
MakeTutor(id,Text[],Color,Float:Time = 0.0)
{
client_cmd( id, "spk %s", MSOUND )
if(is_user_connected( id ))
{
message_begin(MSG_ONE_UNRELIABLE,g_MsgTutor,_,id)
write_string(Text)
write_byte(0)
write_short(0)
write_short(0)
write_short(1<<Color)
message_end()
}
if(Time != 0.0)
{
if( task_exists( id + TASK_TUT ) )
{
remove_task( id + TASK_TUT )
}
set_task(Time,"RemoveTutor",id + TASK_TUT)
}
}
public RemoveTutor(taskID)
{
new id = taskID - TASK_TUT
message_begin(MSG_ALL,g_MsgTutClose,_,id)
message_end()
}
public zoom(id)
{
if(gCvarNozoom)
{
client_cmd(id, "drop")
}
}
public ev_CurWeapon(id)
{
if(!is_user_connected(id) || !is_user_alive(id))
{
return PLUGIN_HANDLED;
}
new Weapon_Id = read_data(2)
if(Weapon_Id == CSW_KNIFE && PLEVEL[ id ] >= 5 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_knife.mdl")
}
if(Weapon_Id == CSW_ELITE && PLEVEL[ id ] >= 7 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_elite.mdl")
}
if(Weapon_Id == CSW_GLOCK18 && PLEVEL[ id ] >= 8 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_glock18.mdl")
}
if(Weapon_Id == CSW_DEAGLE && PLEVEL[ id ] >= 10 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_gdeagle.mdl")
}
if(Weapon_Id == CSW_USP&& PLEVEL[ id ] >= 15 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_usp.mdl")
}
if(Weapon_Id == CSW_HEGRENADE && PLEVEL[ id ] >= 20 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_shegrenade.mdl")
}
if(Weapon_Id == CSW_P90 && PLEVEL[ id ] >= 25 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_p90.mdl")
}
if(Weapon_Id == CSW_GALIL && PLEVEL[ id ] >= 30 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_gail.mdl")
}
if(Weapon_Id == CSW_FAMAS && PLEVEL[ id ] >= 40 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_famas.mdl")
}
if(Weapon_Id == CSW_M249 && PLEVEL[ id ] >= 50 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_m249.mdl")
}
if(Weapon_Id == CSW_AK47 && PLEVEL[ id ] >= 60 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_ak47.mdl")
}
if(Weapon_Id == CSW_MP5NAVY && PLEVEL[ id ] >= 65 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_mp5.mdl")
}
if(Weapon_Id == CSW_M4A1 && PLEVEL[ id ] >= 75 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_m4a1.mdl")
}
if(Weapon_Id == CSW_M3 && PLEVEL[ id ] >= 120 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_m3.mdl")
}
if(Weapon_Id == CSW_SCOUT && PLEVEL[ id ] >= 200 )
{
set_pev(id, pev_viewmodel2, "models/customs/v_scout.mdl")
}
return PLUGIN_CONTINUE;
}
public fwHamTakeDamage(victim, inflictor, attacker, Float:damage, damagebits)
{
if(get_user_weapon(attacker) == CSW_KNIFE && PLEVEL[ attacker ] >= 5)
{
SetHamParamFloat(4, damage * 1.5)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_ELITE && PLEVEL[ attacker ] >= 7)
{
SetHamParamFloat(4, damage * 1.5)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_GLOCK18 && PLEVEL[ attacker ] >= 8)
{
SetHamParamFloat(4, damage * 1.0)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_DEAGLE && PLEVEL[ attacker ] >= 10)
{
SetHamParamFloat(4, damage * 1.3)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_USP && PLEVEL[ attacker ] >= 15)
{
SetHamParamFloat(4, damage * 1.1)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_HEGRENADE && PLEVEL[ attacker ] >= 20)
{
SetHamParamFloat(4, damage * 1.4)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_P90 && PLEVEL[ attacker ] >= 25)
{
SetHamParamFloat(4, damage * 1.4)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_GALIL && PLEVEL[ attacker ] >= 30)
{
SetHamParamFloat(4, damage * 1.3)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_FAMAS && PLEVEL[ attacker ] >= 40)
{
SetHamParamFloat(4, damage * 1.2)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_M249 && PLEVEL[ attacker ] >= 50)
{
SetHamParamFloat(4, damage * 1.2)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_AK47 && PLEVEL[ attacker ] >= 60)
{
SetHamParamFloat(4, damage * 1.2)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_MP5NAVY && PLEVEL[ attacker ] >= 65)
{
SetHamParamFloat(4, damage * 1.2)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_M4A1 && PLEVEL[ attacker ] >= 75)
{
SetHamParamFloat(4, damage * 1.3)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_M3 && PLEVEL[ attacker ] >= 120)
{
SetHamParamFloat(4, damage * 1.6)
return HAM_HANDLED
}
if(get_user_weapon(attacker) == CSW_SCOUT && PLEVEL[ attacker ] >= 200)
{
SetHamParamFloat(4, damage * 1.7)
return HAM_HANDLED
}
return HAM_IGNORED
} |