AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Simple Script Help (https://forums.alliedmods.net/showthread.php?t=40940)

ClanStyles 07-06-2006 13:59

Simple Script Help
 
Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "Custom F.U.N Plugin"
#define VERSION "1.0"
#define AUTHOR "Styles"


public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")
   
}

public Event_CurWeapon(id)
{
  new oldspeed[id] = get_user_maxspeed(id);
   
   
    if(CSW_KNIFE)
    {
        set_user_maxspeed(id,700.0);
        set_hudmessage(255, 170, 0, -1.0, 0.32, 0, 6.0, 12.0);
        show_hudmessage(id, "--> You know can go faster <--");
    }
    else
    {
        set_user_maxspeed(id,oldspeed[id]);
        set_hudmessage(255, 170, 0, -1.0, 0.32, 0, 6.0, 12.0);
        show_hudmessage(id, "--> Your speed is now over <--");
    }
}

i get an:
Must be constant expression; assumed zero for lines 18 x2

and Emty Statement on 19 and fatal error 107 to many errors

shino 07-06-2006 14:04

Re: Simple Script Help
 
try to not use oldspeed:
Code:
public Event_CurWeapon(id) {      if(CSW_KNIFE)     {         set_user_maxspeed(id,700.0);         set_hudmessage(255, 170, 0, -1.0, 0.32, 0, 6.0, 12.0);         show_hudmessage(id, "--> You know can go faster <--");     }     else     {         set_user_maxspeed(id,320.0); // 320 == normal speed         set_hudmessage(255, 170, 0, -1.0, 0.32, 0, 6.0, 12.0);         show_hudmessage(id, "--> Your speed is now over <--");     } }

ClanStyles 07-06-2006 14:27

Re: Simple Script Help
 
thx :) Testing it now

Done testing now the bugs i need help w/

one is that there ALLWAYS going fast! Not just w/ knife.

Also they can change there cl_forwardspeed and maket hemselfs go WAY to fast.

Rolnaaba 07-06-2006 16:26

Re: Simple Script Help
 
Code:
<div align="left">#include <amxmodx></div></p><p><div align="left">#include <amxmisc></div></p><p><div align="left">#include <cstrike></div></p><p><div align="left">#include <fun></div></p><p></p><p><div align="left">#define PLUGIN "Custom F.U.N Plugin"</div></p><p><div align="left">#define VERSION "1.0"</div></p><p><div align="left">#define AUTHOR "Styles"</div></p><p></p><p></p><p><div align="left">public plugin_init() {</div></p><p><div align="left"> register_plugin(PLUGIN, VERSION, AUTHOR)</div></p><p><div align="left"> register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")</div></p><p></p><p><div align="left">}</div></p><p></p><p><div align="left">public Event_CurWeapon(id) </div></p><p><div align="left">{</div></p><p><div align="left"> if(CSW_KNIFE)</div></p><p><div align="left"> {</div></p><p><div align="left"> set_user_maxspeed(id,700.0);</div></p><p><div align="left"> set_hudmessage(255, 170, 0, -1.0, 0.32, 0, 6.0, 12.0);</div></p><p><div align="left"> show_hudmessage(id, "--> You know can go faster <--");</div></p><p><div align="left"> return PLUGIN_CONTINUE;</div></p><p><div align="left"> }</div></p><p><div align="left"> else</div></p><p><div align="left"> {</div></p><p><div align="left"> set_user_maxspeed(id,oldspeed[id]);</div></p><p><div align="left"> set_hudmessage(255, 170, 0, -1.0, 0.32, 0, 6.0, 12.0);</div></p><p><div align="left"> show_hudmessage(id, "--> Your speed is now over <--");</div></p><p><div align="left"> return PLUGIN_CONTINUE;</div></p><p><div align="left"> }</div></p><p><div align="left">}</div>



try it like that

Rolnaaba 07-06-2006 16:26

Re: Simple Script Help
 
[small]
Code:
<div align="left">#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #define PLUGIN "Custom F.U.N Plugin" #define VERSION "1.0" #define AUTHOR "Styles" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("CurWeapon", "Event_CurWeapon", "be", "1=1")     } public Event_CurWeapon(id) {     if(CSW_KNIFE)     {         set_user_maxspeed(id,700.0);         set_hudmessage(255, 170, 0, -1.0, 0.32, 0, 6.0, 12.0);         show_hudmessage(id, "--> You know can go faster <--");         return PLUGIN_CONTINUE;     }     else     {         set_user_maxspeed(id,oldspeed[id]);         set_hudmessage(255, 170, 0, -1.0, 0.32, 0, 6.0, 12.0);         show_hudmessage(id, "--> Your speed is now over <--");         return PLUGIN_CONTINUE;     } }</div>

sry for double post



All times are GMT -4. The time now is 08:03.

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