Raised This Month: $ Target: $400
 0% 

Help With Speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-22-2005 , 20:54   Help With Speed
Reply With Quote #1

Ok.. This Compiles With 11 Warnings And 0 Errors

Code:
#pragma tabsize 0 //======================================================= #include <amxmodx> #include <cstrike> #include <fun> //======================================================= new bool:hashadspeed[32] new bool:hasnothadspeed[32] //======================================================= /******************************************************************* *Need For Speed: By: Dizzy                            *===============                                      *Description - Gives You Extra Speed For Either                 *5 or 10 Seconds For A Price (1 Per Round)                  *                                               *Cvars - sv_nfs 0|1 [Off|On]                                *                                               *Clcmds - /needspeed5 - Gives 5 Seconds Of Speed For 800 Dollars   *         /needspeed10 - Gives 10 Seconds Of Speed For 1600 Dollars *             /needspeed - Tells Client If NFS Is On Or Off           *                                                 *Comments? - Email: <a href="mailto:[email protected]">[email protected]</a>                  *          AIM: AwPOAwPDiZzY                          *******************************************************************/ //======================================================= //======================================================= public plugin_init() {     register_plugin("Need For Speed",".1","Dizzy")     register_cvar("sv_nfs","1")     register_clcmd("say /needspeed5","speed5")     register_clcmd("say /needspeed10","speed10")     register_clcmd("say /needspeed","speed")     register_event("ResetHUD","newround","b") } //======================================================= //======================================================= public client_connect(id) {     hashadspeed[id] = false     hasnothadspeed[id] = true } public client_disconnect( id ) {     hashadspeed[id] = false     hasnothadspeed[id] = true } //======================================================= //======================================================= public speed5(id) {    if (get_cvar_num("sv_nfs")==0)       client_print(0,print_chat,"[AMXX][Need For Speed] Is Off!")       return PLUGIN_HANDLED    if (hashadspeed[id])       client_print(0,print_chat,"[AMXX][Need For Speed] Sorry, Try Next Round!")       return PLUGIN_HANDLED    set_user_maxspeed(id, set_user_maxspeed(id) + 300)    cs_set_user_money(id, cs_get_user_money(id) - 800)    client_print(0,print_chat,"[AMXX][Need For Speed] You Have Speed For 5 Seconds!")    set_task(5.0,"Turn_Speed_Off5",id,"id",3)    client_print(0,print_chat,"[AMXX][Need For Speed] 5 Seconds Has Gone By!")    hashadspeed[id] = true    hasnothadspeed[id] = false       return PLUGIN_HANDLED } //======================================================= //======================================================= public speed10(id) {    if (get_cvar_num("sv_nfs")==0)       client_print(0,print_chat,"[AMXX][Need For Speed] Is Off!")       return PLUGIN_HANDLED    if (hashadspeed[id])       client_print(0,print_chat,"[AMXX][Need For Speed] Sorry, Try Next Round!")       return PLUGIN_HANDLED    set_user_maxspeed(id, set_user_maxspeed(id) + 300)    cs_set_user_money(id, cs_get_user_money(id) - 1600)    client_print(0,print_chat,"[AMXX][Need For Speed] You Have Speed For 10 Seconds!")    set_task(10.0,"Turn_Speed_Off10",id,"id",3)    client_print(0,print_chat,"[AMXX][Need For Speed] 10 Seconds Has Gone By!")    hashadspeed[id] = true    hasnothadspeed[id] = false       return PLUGIN_HANDLED } //======================================================= //======================================================= public speed(id) {    if (get_cvar_num("sv_nfs")==0)       client_print(0,print_chat,"[AMXX][Need For Speed] Is Off!")        return PLUGIN_CONTINUE    if (get_cvar_num("sv_nfs")==1)       client_print(0,print_chat,"[AMXX][Need For Speed] Is On!")          return PLUGIN_CONTINUE    if (hashadspeed[id])       client_print(0,print_chat,"[AMXX][Need For Speed] You Have Had Speed This Round!")        return PLUGIN_CONTINUE    if (hasnothadspeed[id])       client_print(0,print_chat,"[AMXX][Need For Speed] You Have Not Had Speed This Round!")          return PLUGIN_CONTINUE } //======================================================= //======================================================= public Turn_Speed_Off5(id) {    set_user_maxspeed(id, set_user_maxspeed(id) - 300)       return PLUGIN_HANDLED } //======================================================= //======================================================= public Turn_Speed_Off10(id) {    set_user_maxspeed(id, set_user_maxspeed(id) - 300)       return PLUGIN_HANDLED } //======================================================= //======================================================= public roundchange(id) {    hashadspeed[id] = false    hasnothadspeed[id] = true       return PLUGIN_CONTINUE } //=======================================================

What This Does Is It Is Suppose To Give A Client Speed For 5 or 10 Seconds Depending On The command the client does...

the commands are

/needspeed5
/needspeed10
/needspeed

/needspeed Gives them information about the plugin

If They Have Used It Or If The Plugin is Even on...

When They Get The Plugin For 5 Seconds It Takes 800 Dollars Away

when they get it for 10 seconds it takes 1600 dollars away...

It doesn't work on my Deticated Server...

Any Help? Thanks
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 02-22-2005 , 20:56  
Reply With Quote #2

Try using braces with your if statements...
__________________
twistedeuphoria is offline
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-22-2005 , 21:02  
Reply With Quote #3

? With What Statements?
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 02-22-2005 , 21:09  
Reply With Quote #4

Code:
public speed(id) { 

   if (get_cvar_num("sv_nfs")==0) { 
      client_print(0,print_chat,"[AMXX][Need For Speed] Is Off!") 

       return PLUGIN_CONTINUE 
}
   if (get_cvar_num("sv_nfs")==1) {
      client_print(0,print_chat,"[AMXX][Need For Speed] Is On!") 

         return PLUGIN_CONTINUE 
}
   if (hashadspeed[id]) {
      client_print(0,print_chat,"[AMXX][Need For Speed] You Have Had Speed This Round!") 

       return PLUGIN_CONTINUE 
}
   if (hasnothadspeed[id]) {
      client_print(0,print_chat,"[AMXX][Need For Speed] You Have Not Had Speed This Round!") 

         return PLUGIN_CONTINUE 
}
return PLUGIN_CONTINUE
}
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
johnjg75
Veteran Member
Join Date: Mar 2004
Location: Delaware
Old 02-22-2005 , 21:17  
Reply With Quote #5

Code:
set_user_maxspeed(id, set_user_maxspeed(id) + 300)    cs_set_user_money(id, cs_get_user_money(id) - 1600) set_user_maxspeed(id, set_user_maxspeed(id) - 300)
dude, i don't know what ur trying to do but that's completely incorrect. if u wanna get how much they have, then deduct it, then make a var and use the "get_*" command...

sry, i havent had much sleep n i'm a bit grouchy...
__________________
johnjg75 is offline
Send a message via AIM to johnjg75 Send a message via MSN to johnjg75 Send a message via Yahoo to johnjg75
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-22-2005 , 21:20  
Reply With Quote #6

Well...

I just want it to give them speed (like +300) and take 1600 away from them and they get the speed for 10 seconds?

What did I do wrong?
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:58.


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