AlliedModders

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

EpicFail. 08-13-2010 08:21

Help.. Speed
 
Hmm.. i make a Hns Shop and when i buy Faster Speed
and Change weapon this remove the speed ..

How i can fix this

drekes 08-13-2010 08:25

Re: Help.. Speed
 
PHP Code:

#include <amxmodx>
#include <fun>

new Floatspeed 400.0;

public 
plugin_init()
    
register_event("CurWeapon""Event_CurWeapon""be");
    
public 
Event_CurWeapon(id)
{
    if(
is_user_alive(id))
        
set_user_maxspeed(idspeed);



EpicFail. 08-13-2010 08:32

Re: Help.. Speed
 
this code give auto speed for how connect to server ..

drekes 08-13-2010 08:39

Re: Help.. Speed
 
Well, you have to integrate it in your code.
It's just an example

EpicFail. 08-13-2010 08:46

Re: Help.. Speed
 
Quote:

Originally Posted by drekes (Post 1269564)
Well, you have to integrate it in your code.
It's just an example

if i give you my code you can do this for me ?

EpicFail. 08-13-2010 09:18

Re: Help.. Speed
 
Okay i get this .. (i make one for me)
now how i can make Remove Task for this .. ?

DarkGod 08-13-2010 09:39

Re: Help.. Speed
 
Use a boolean and set_task() to the amount of time you want it to last, then in the task function you set the boolean to false and reset maxspeed.

EpicFail. 08-13-2010 10:19

Re: Help.. Speed
 
@DarkGod
i do this and this wont work ..

can you make one for me or something

fireattack 08-15-2010 16:43

Re: Help.. Speed
 
I'm bored, so i'm gonna make the plugin for you.
Edit in 5 minutes :crab:

EDIT: Sorry, i was withouth internet.
Here you go

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
 
new t_player_class[33]
 
// Init
public plugin_init() 
{
 
register_plugin("HnSShop""0.1""extr")
 
register_clcmd("say /shop""shop")
 
register_event("CurWeapon""curweapon""be""1=1")
}
 
// Let's create the menu!
public shop(id)
{
 if(
is_user_alive(id) || is_user_connected(id)) 
 {
  new 
menu menu_create("\rHnS Shop:""shop1")
  
menu_additem(menu"HOLYSHITSPEED FOR 1000$!!!""1"0)
  
menu_setprop(menuMPROP_EXITMEXIT_ALL)
  
menu_display(idmenu0)
 }
}
 
// Skills
public shop1(idmenuitem)
{
 if( 
item == MENU_EXIT )
 {
  
menu_destroy(menu)
  return 
PLUGIN_HANDLED
 
}
 new 
data[6], iName[64]
 new 
accesscallback
 menu_item_getinfo
(menuitemaccessdata,5iName63callback)
 new 
key str_to_num(data)
 switch(
key)
 {
  case 
:
  {
  if (
cs_get_user_money(id) < 1000)
  {
  
client_print(idprint_chat"^4[Shop]^3 You havent money!");
  return 
PLUGIN_HANDLED;
  }
  if (!
is_user_alive(id))
  {
  
client_print(idprint_chat"^4[Shop]^3 You have to be alive!");
  return 
PLUGIN_HANDLED;
  }
  if (
cs_get_user_money(id) >= 1000 )
  {
   
client_print(idprint_chat"^4[Shop]^3 BOUGHT!!!!")
   
t_player_class[id] = // Set the id to the curweapon
 
   
if(is_user_connected(id))
   {
    
set_user_maxspeed(id800.0// Set the speed
   
}
   
cs_set_user_money(id cs_get_user_money(id) - 10000// Money
  
}
 }
  }
 
menu_destroy(menu)
 return 
PLUGIN_HANDLED
}
 
// The event
public curweapon(id// I think you can understand this, its for the event "curweapon"
{
 if(
t_player_class[id])
 {
  switch(
t_player_class[id])
  {
   case 
1:
   { 
    
set_user_maxspeed(id800.0)
   }
  }
 }



Hunter-Digital 08-15-2010 19:14

Re: Help.. Speed
 
Quote:

Originally Posted by fireattack (Post 1271844)
I'm bored, so i'm gonna make the plugin for you.
Edit in 5 minutes :crab:

It's been two hours :lol:


All times are GMT -4. The time now is 21:51.

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