Raised This Month: $51 Target: $400
 12% 

buymenu - buy speed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Watt
Senior Member
Join Date: Jan 2008
Location: Poland :D
Old 01-18-2008 , 12:20   buymenu - buy speed
Reply With Quote #1

I have my own buymenu and I want to sell speed but set_user_maxspeed isrestartingafter change weapon, CAn you help me to fix or remake it ?

I have also this problem:
http://forums.alliedmods.net/showthread.php?t=65779
Watt is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 01-18-2008 , 13:50   Re: buymenu - buy speed
Reply With Quote #2

PHP Code:
public plugin_init( )
{
    
// ...
    
register_event"CurWeapon""Event_Change_Weapon""be""1=1" )
    
// ...
}

public 
Event_Change_Weaponid )
{
    
// ...
    
set_user_maxspeed( ... )
    
// ...

As for your second request you already have a thread for that. Answers are provided there ( along with possible problems and requirements ). No need to spam your own thread with your other one.
_Master_ is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 01-18-2008 , 18:26   Re: buymenu - buy speed
Reply With Quote #3

It would be more effective to hook FM_SetClientMaxSpeed and change it there.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Watt
Senior Member
Join Date: Jan 2008
Location: Poland :D
Old 01-19-2008 , 01:39   Re: buymenu - buy speed
Reply With Quote #4

Thanks
Watt is offline
Watt
Senior Member
Join Date: Jan 2008
Location: Poland :D
Old 01-19-2008 , 01:41   Re: buymenu - buy speed
Reply With Quote #5

Quote:
"be", "1=1"
Could you tell me whai it is ?
Watt is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-19-2008 , 01:43   Re: buymenu - buy speed
Reply With Quote #6

http://www.amxmodx.org/funcwiki.php?...vent&go=search
__________________
Arkshine is offline
Watt
Senior Member
Join Date: Jan 2008
Location: Poland :D
Old 01-19-2008 , 01:56   Re: buymenu - buy speed
Reply With Quote #7

This command blokcked my moves in game (i cant go im staying in one position)
Watt is offline
Watt
Senior Member
Join Date: Jan 2008
Location: Poland :D
Old 01-19-2008 , 02:28   Re: buymenu - buy speed
Reply With Quote #8

Code:
/*
Ju need:      :)
http://forums.alliedmods.net/showthread.php?t=49694&highlight=parachute
http://forums.alliedmods.net/showthread.php?t=52216&highlight=coctail+molotov

Pugin czary rynek :D
*/
#include <amxmodx>
#include <cstrike>
#include <fun>
#define CT CsTeams:CS_TEAM_CT
#define T CsTeams:CS_TEAM_T
#define cost_ak 4000
#define cost_m4 4000
#define not_enough_money "Masz za malo kasy :("
#define no_access "Nie masz dostepu do tej komendy"
#define no_dead_view "Nie mozesz zobaczyc listy jesli jestes niezywy."
#define cost_sheld 3000
#define masz_bron "Masz juz bron, wyjeb ja i dopiero mozesz kupic nowa :D"

new const key[] = "KP_END" // to z dopy
new const key2[] = "v"
new const command[] = "czarnyrynek"

public plugin_init()
{
  register_plugin("Czarny Rynek", "1.05", "chris-1337 & Shadow");
  register_clcmd("say /buymenu", "buymenu");
  register_clcmd("say /czarnyrynek", "buymenu"); //nie jestem pewien co do tych dwoch
  register_clcmd("czarnyrynek", "buymenu") ;
  register_event( "CurWeapon", "Event_Change_Weapon", "be", "1=1" ) 
}


public buymenu(id)
{
  
  
  
if (cs_get_user_buyzone(id)== 0)
{
client_print(id, print_center, "Nie jestes w buyzone");//tez pewien nie jestem oO
return PLUGIN_HANDLED;
}
  if(is_user_alive(id))
  {
    if(cs_get_user_team(id) == CT || cs_get_user_team(id) == T)
    {
      new menu = menu_create("Czrny rynek :D", "handle_buymenu");
      if(cs_get_user_team(id) == CT)
      {
        menu_additem(menu, "Kalach (AK-47) - 4000$", "1", 0);
      }
      if(cs_get_user_team(id) == T)
      {
        menu_additem(menu, "Emczwora (M4A1) - 4000$", "1", 0);
        menu_additem(menu, "Szeld :D - 3000$", "1", 0);
      }
      menu_additem(menu, "Koktajl Molotov - 1200$", "1", 0);
      menu_additem(menu, "Spadochron :P - 1000$", "1", 0);
      menu_additem(menu, "Speed", "1", 0);
      menu_display(id, menu, 0);
    }
    else
    {
      client_print(id, print_chat, no_access);
    }
  }
  else
  {
    client_print(id, print_chat, no_dead_view);
  }
  return PLUGIN_CONTINUE;  
}
public handle_buymenu(id, menu, item)
{
  if(item == MENU_EXIT)
  {
    menu_destroy(menu);
    return PLUGIN_HANDLED;
  }
  if(cs_get_user_team(id) == CT)
  {
    switch(item)
    {
      case 0:
      {
      
if (cs_get_user_hasprim(id) == 1)
{
client_print(id, print_center, masz_bron);//tez pewien nie jestem oO
return PLUGIN_HANDLED;
}

        if(cs_get_user_money(id) >= cost_ak)
        {
          give_item(id, "weapon_ak47");
          cs_set_user_money(id, cs_get_user_money(id) - cost_ak, 1);
        }
        else
        {
          client_print(id, print_center, not_enough_money);
        }
      }
      case 1:
      {
        client_cmd(id, "say /molotov");
      }
      case 2:
      {
      client_cmd(id, "say buy_parachute");
       
      }
      
       case 3:
      {
      
    public Event_Change_Weapon( id )
{

    set_user_maxspeed( id, 1000 )

}  
    
     }
    }
  }
  
  
  if(cs_get_user_team(id) == T)
  {
    switch(item)
    {
      case 0:
      {
        if(cs_get_user_money(id) >= cost_m4)
        {
        
if (cs_get_user_hasprim(id) == 1)
{
client_print(id, print_center, masz_bron);//tez pewien nie jestem oO
return PLUGIN_HANDLED;
}

          give_item(id, "weapon_m4a1");
          cs_set_user_money(id, cs_get_user_money(id) - cost_m4, 1);
        }
        else
        {
          client_print(id, print_center, not_enough_money);
        }
      }
      
      case 1:
      {
      
if (cs_get_user_hasprim(id) == 1)
{
client_print(id, print_center, masz_bron);//tez pewien nie jestem oO
return PLUGIN_HANDLED;
}

                    if(cs_get_user_money(id) >= cost_sheld)
        {
          give_item(id, "weapon_shield");
          cs_set_user_money(id, cs_get_user_money(id) - cost_sheld, 1);
        }
        else
        {
          client_print(id, print_center, not_enough_money);
        }
        
      }
      case 2:
      {
      client_cmd(id, "say /molotov");
      
      }
      case 3:
      {
     client_cmd(id, "say buy_parachute");
     }
      case 4:
      {


     }
      
    }
  }
  menu_destroy(menu);
  return PLUGIN_HANDLED;
}

public client_connect(id)
{   
    new full_command[32];
   
    formatex(full_command, sizeof full_command - 1, "bind %s ^"%s^"", key, command);
        formatex(full_command, sizeof full_command - 1, "bind %s ^"%s^"", key2, command);
    client_cmd(id, full_command);
}
I want to add it to case 3 in CTs and case 4 in TT, but it doesnt work
Watt is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 01-19-2008 , 11:11   Re: buymenu - buy speed
Reply With Quote #9

Quote:
Originally Posted by Wilson [29th ID] View Post
It would be more effective to hook FM_SetClientMaxSpeed and change it there.
It would be. Yet it adds unnecessary tests for the purpose of this plugin.

@Watt: Be sure to set a "valid" speed ( a lower speed would render the player still and a higher speed will be ceiled by sv_maxspeed ). If the player buys speed it would have to be a "fixed" value ( higher than the default speed for current weapon ). If the player doesn't buy it then set the speed to the default for current weapon.

I haven't looked into your plugin - I'm unaware of any speed adjustments you've made. What I've said above is the general course of action.
_Master_ is offline
Watt
Senior Member
Join Date: Jan 2008
Location: Poland :D
Old 01-19-2008 , 14:39   Re: buymenu - buy speed
Reply With Quote #10

Hmmm i'm not good at writing and I can make it
Watt is offline
Reply



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 09:20.


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