AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Check my work lol :) (https://forums.alliedmods.net/showthread.php?t=45436)

Rolnaaba 10-02-2006 10:28

Check my work lol :)
 
who wants to read my code to make sure I did it right? :D lol feel free to make fun of my code or to change it and tell me what i did wrong.
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> new bool:DamageDone new bool:FirstDeathDone new const FirstDamageSound[] = "sounds/FirstDamage.mp3" new const KnifeDeathSound[] = "sounds/Idiot.mp3" new const AdminDieSound[] = "sounds/Wtf.mp3" new const FreezeTimeEndSound[] = "sounds/Num1.mp3" new const DisconnectSound[] = "sounds/Mario.mp3" new const FirstDeathSound[] = "sounds/Kenny.mp3" new const AdminDieSound3[] = "sounds/Pray.mp3" new const AdminDieSound5[] = "sounds/Bendover.mp3" new const 3KillInRowSound[] = "sounds/KickAss.mp3" public plugin_precache() {  precache_generic(FirstDamageSound)  precache_generic(KnifeDeathSound)  precache_generic(AdminDieSound)  precache_generic(FreezeTimeEndSound)  precache_generic(DisconnectSound)  precache_generic(FirstDeathSound)  precache_generic(AdminDieSound3)  precache_generic(AdminDieSound5)  precache_generic(3KillInRowSound) } public plugin_init() {  register_plugin("test", "test", "test")  register_event("HLTV", "newround", "a", "1=0", "2=0")  register_event("Damage", "FirstDamage", "a")  register_event("DeathMsg", "Death", "a", "1>0")  register_event("DeathMsg", "AdminDie", "b")  register_logevent("logevent_round_start", 2, "1=Round_Start") } public newround(id) { //sets variables that control first_damage, and first_death sounds to false  DamageDone = false  FirstDeathDone = false } public FirstDamage(id) { //is called whenever dmaage is dealt  if (DamageDone == false) {//checks if damage has been done already   client_cmd(0, "mp3 play %s", FirstDamageSound) //plays first damage sound   DamageDone = true //makes sure this only happens on first damage (per round)  } } public Death() { //is called upon death of anyone  new WeaponName[20]  new WeaponID = get_weaponid(WeaponName)      read_data(4, WeaponName, 19)      if(WeaponID == CSW_KNIFE) { //checks if Death was result of knife   client_cmd(0, "mp3 play %s", KnifeDeathSound) //plays knife death sound  }  else if(FirstDeathDone == false) { //if death wasnt result of knife, and is first death continues   client_cmd(0, "mp3 play %s", FirstDeathSound) //plays First death sound   FirstDeathDone = true //makes sure only plays first death sound once per round  } } public AdminDie(id, level, cid) { //is called upon death of anyone  new Victim = read_data(2) //get victim's ID  if(access(Victim, ADMIN_LEVEL_B)) { //checks access level of the victim   client_cmd(0, "mp3 play %s", AdminDieSound) //plays Admin death sound  } } public logevent_round_start() { //is called at end of freeze time  client_cmd(0, "mp3 play %s", FreezeTimeEndSound) //plays freeze time end sound } public client_disconnect(id) { //is called when someone disconnects  client_cmd(0, "mp3 play %s", DisconnectSound) //plays disconnect sound }

just ignore the 3kill in row, and admin die 3 and admindie5 sounds havent made those yet.

allenwr 10-02-2006 10:40

Re: Check my work lol :)
 
IM a little noobish this morning, but i say...

I like it, and it looks good. +karma

Xanimos 10-02-2006 11:41

Re: Check my work lol :)
 
ahem :Cough:
Code:
public precache() {
to
Code:
public plugin_precache() {

Rolnaaba 10-02-2006 15:13

Re: Check my work lol :)
 
omfg I can't believe I actually did that. thanks but what I am realy looking for is someone to maybe, test? and check if it works well

MaximusBrood 10-02-2006 17:25

Re: Check my work lol :)
 
Your avatar isn't even remotely funny...

Charming 10-02-2006 18:35

Re: Check my work lol :)
 
Quote:

Originally Posted by MaximusBrood (Post 386924)
Your avatar isn't even remotely funny...

lol brood take it easy on the kid ^-^

TheNewt 10-02-2006 19:00

Re: Check my work lol :)
 
Brood your avatar isn't all that funny either ^.^

Xanimos 10-03-2006 01:05

Re: Check my work lol :)
 
Oh and it is also "mp3 play <mp3>" not "play mp3 <mp3>"

Rolnaaba 10-03-2006 09:42

Re: Check my work lol :)
 
thanks Xanimos for staying on topic correcting...

Brad 10-03-2006 09:49

Re: Check my work lol :)
 
Why do you want someone else to test it? i.e. Why can't/won't you test it yourself?


All times are GMT -4. The time now is 04:55.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.