AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   n+= Not doing right? (https://forums.alliedmods.net/showthread.php?t=17857)

Zenith77 09-10-2005 12:23

n+= Not doing right?
 
Alright this is not working( the motd doesnt show up :/

Code:
public coinmod_help(id) {     new len = 1600     new buffer[1601]     new n = 0         client_cmd(id, "spk ^"vox/help message accquired^" " )         #if !defined NO_STEAM     n += copy(buffer[n],len-n,"<html><head><style type=^"text/css^">pre{color:#FFB000;}body{background:#000000;margin-left:8px;margin-top:0px;}</style></head><body><pre>^n")     #endif         n += copy(buffer[n],len-n,"-= Welcome to Coin Mod Help! Here you will find basic help topics about Coin Mod =-^n^n")         if( isBanned[id] == 1) {         n += copy(buffer[n],len-n,"STATUS: ***BANNED***^n^n")     }         else {         n += copy(buffer[n],len-n,"STATUS: GOOD( Not Banned )^n^n")     }             n += copy(buffer[n],len-n,"What is Coin Mod, and how does it work?^n^n")     n += copy(buffer[n],len-n,"Coin Mod gives players rewards through a coin based system. You collect coins by dealing damage to your opponetes,^n")     n += copy(buffer[n],len-n,"( NOTE: Doing damage to a friendly player will decrease your coins, not increase them! ) ^n")     n += copy(buffer[n],len-n,"which coins will then appear and float towards you. There are three types of coins in Coin Mod: the bronze coin, ^n")     n += copy(buffer[n],len-n,"the silver coin, and the gold coin. Each coin has its own value or ^"worth^". The bronze coin is worth 5 coins. The^n")     n += copy(buffer[n],len-n,"silver coin is worth 10. And the gold coin is worth 15. As stated early, these coins are spawned by dealing damage to an opponet^n")     n += copy(buffer[n],len-n,"or killing them. Different coins are spawned according to the damage you do! If you do less the 25 damage a bronze coined is spawned,^n")     n += copy(buffer[n],len-n,"If you do over 25 damage but under 50 a silver coined is spawned. If you do over 50 damage a gold coined is spawned, And lastly, if you kill a person 1 gold coin is spawned! ")     n += copy(buffer[n],len-n,"But if you kill a person with a head shot, not 1 but 3 gold coins are spawned! ^n")     n += copy(buffer[n],len-n,"Your coins at the beggining of every round are calculated! Your damage increases by 5 for every 25 coins you have!^n")     n += copy(buffer[n],len-n,"After calculations though, those 25 coins are taken away!^n^n")         n += copy(buffer[n],len-n,"=== TK SYSTEM ===^n")     n += copy(buffer[n],len-n,"A user is banned from Coin Mod after he/she has^n")     n += copy(buffer[n],len-n,"gone past the ^"Inoccent Ban^" proof system,^n")     n += copy(buffer[n],len-n,"meaning he/she has hit the same person ten or^n")     n += copy(buffer[n],len-n,"above times, and has reached the max TKs^n")     if( is_user_admin(id)) {         n += copy(buffer[n],len-n,"controlled by the cvar coinmod_maxtks !^n")     }     n += copy(buffer[n],len-n,"======^n^n")         n += copy(buffer[n],len-n,"COMMANDS:^n")     n += copy(buffer[n],len-n,"say /coinhelp -- shows this help info^n")     n += copy(buffer[n],len-n,"say /coinstat -- shows how many coins you have^n")         if( is_user_admin(id)) {         n += copy(buffer[n],len-n,"ADMIN COMMANDS:^n^n")         n += copy(buffer[n],len-n,"coin_addcoins <target> <amount>^n")         n += copy(buffer[n],len-n,"coin_takecoins <target> <amount>^n")         n += copy(buffer[n],len-n,"coin_getcoins <target> Retervies client info related to Coin Mod^n^n")     }           n += copy(buffer[n],len-n,"Thank you for playing Coin Mod V.1.0!")         #if !defined NO_STEAM     n += copy(buffer[n],len-n,"</pre></body></html>")     #endif         show_motd(id,buffer[n],"COIN MOD V.1.0 Help BY: Zenith77")     client_print(id, print_chat, " Guess it dont work :/ " ) }

v3x 09-10-2005 12:29

Why not use format()?

Zenith77 09-10-2005 12:32

i didnt think it would work like that...and i already did this :/ so why wont it show?

v3x 09-10-2005 12:40

Try using format like this:
Code:
new message[899],len; len = format(message,898,"<blahhh>"); len += format(message[len],898-len,"some info"); len += format(message[len],898-len,"some other info"); show_motd(id,message,"COIN MOD V.1.0 Help BY: Zenith77");

PM 09-10-2005 12:52

copy is ok, no need to use format.

But:
Code:
show_motd(id,buffer[n],"COIN MOD V.1.0 Help BY: Zenith77")
Shouldn't that be
Code:
show_motd(id,buffer,"COIN MOD V.1.0 Help BY: Zenith77")

Zenith77 09-10-2005 13:10

Yea thats what i did at first it still doent show up :/

Zenith77 09-10-2005 21:38

*bump*

Freecode 09-10-2005 21:43

that looks right with PM's fix.

Zenith77 09-10-2005 22:11

i know thats what i had originally, but changed it to buffer[n], then i changed it back, but nothing works :/..unless its just my server :/

this is what i have now,,


Code:
public coinmod_help(id) {         new len = 1600     new buffer[1601]     new n = 0         client_cmd(id, "spk ^"vox/help message acquired^" " )         #if !defined NO_STEAM     n += copy(buffer[n],len-n,"<html><head><style type=^"text/css^">pre{color:#FFB000;}body{background:#000000;margin-left:8px;margin-top:0px;}</style></head><body><pre>^n")     #endif         n += copy(buffer[n],len-n,"-= Welcome to Coin Mod Help! Here you will find basic help topics about Coin Mod =-^n^n")         if( isBanned[id] == 1) {         n += copy(buffer[n],len-n,"STATUS: ***BANNED***^n^n")     }         else {         n += copy(buffer[n],len-n,"STATUS: GOOD( Not Banned )^n^n")     }             n += copy(buffer[n],len-n,"What is Coin Mod, and how does it work?^n^n")     n += copy(buffer[n],len-n,"Coin Mod gives players rewards through a coin based system. You collect coins by dealing damage to your opponetes,^n")     n += copy(buffer[n],len-n,"( NOTE: Doing damage to a friendly player will decrease your coins, not increase them! ) ^n")     n += copy(buffer[n],len-n,"which coins will then appear and float towards you. There are three types of coins in Coin Mod: the bronze coin, ^n")     n += copy(buffer[n],len-n,"the silver coin, and the gold coin. Each coin has its own value or ^"worth^". The bronze coin is worth 5 coins. The^n")     n += copy(buffer[n],len-n,"silver coin is worth 10. And the gold coin is worth 15. As stated early, these coins are spawned by dealing damage to an opponet^n")     n += copy(buffer[n],len-n,"or killing them. Different coins are spawned according to the damage you do! If you do less the 25 damage a bronze coined is spawned,^n")     n += copy(buffer[n],len-n,"If you do over 25 damage but under 50 a silver coined is spawned. If you do over 50 damage a gold coined is spawned, And lastly, if you kill a person 1 gold coin is spawned! ")     n += copy(buffer[n],len-n,"But if you kill a person with a head shot, not 1 but 3 gold coins are spawned! ^n")     n += copy(buffer[n],len-n,"Your coins at the beggining of every round are calculated! Your damage increases by 5 for every 25 coins you have!^n")     n += copy(buffer[n],len-n,"After calculations though, those 25 coins are taken away!^n^n")         n += copy(buffer[n],len-n,"=== TK SYSTEM ===^n")     n += copy(buffer[n],len-n,"A user is banned from Coin Mod after he/she has^n")     n += copy(buffer[n],len-n,"gone past the ^"Inoccent Ban^" proof system,^n")     n += copy(buffer[n],len-n,"meaning he/she has hit the same person ten or^n")     n += copy(buffer[n],len-n,"above times, and has reached the max TKs^n")     if( is_user_admin(id)) {         n += copy(buffer[n],len-n,"controlled by the cvar coinmod_maxtks !^n")     }     n += copy(buffer[n],len-n,"======^n^n")         n += copy(buffer[n],len-n,"COMMANDS:^n")     n += copy(buffer[n],len-n,"say /coinhelp -- shows this help info^n")     n += copy(buffer[n],len-n,"say /coinstat -- shows how many coins you have^n")         if( is_user_admin(id)) {         n += copy(buffer[n],len-n,"ADMIN COMMANDS:^n^n")         n += copy(buffer[n],len-n,"coin_addcoins <target> <amount>^n")         n += copy(buffer[n],len-n,"coin_takecoins <target> <amount>^n")         n += copy(buffer[n],len-n,"coin_getcoins <target> Retervies client info related to Coin Mod^n^n")     }           n += copy(buffer[n],len-n,"Thank you for playing Coin Mod V.1.0!")         #if !defined NO_STEAM     n += copy(buffer[n],len-n,"</pre></body></html>")     #endif         show_motd(id,buffer,"COIN MOD V.1.0 Help BY: Zenith77") }

Freecode 09-10-2005 22:17

add a debug msg like u did in first 1 in the end
Code:
client_print(id, print_chat, " Guess it dont work :/ " )
And tell me if it prints


All times are GMT -4. The time now is 14:19.

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