Raised This Month: $ Target: $400
 0% 

[HELP] With setting gravity on user.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 03-03-2014 , 15:09   [HELP] With setting gravity on user.
Reply With Quote #1

Hi, there, i want to ask you why doesn't this work. I've a VIPmenu where you can choise gravity, but when I make it like this:
set_user_gravity(id, 300.0)
It starts flying in air and it cant fall on the ground. I'm wondering, how can i make it like on deathrun server, or like when you type sv_gravity 300 in console and get low gravity. I'll give you the .sma to take a look on it! It's about the 3rd case, when i want to set the user 300 gravity by choosing option 3 on the menu.

And it looks like this (DEMO) : http://dox.bg/files/dw?a=787b241ce8
PHP Code:
public VipCTMenu_handler(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 
1:
        {
            
set_user_health(idget_user_health(id) + 30);
            
set_user_armor(idget_user_armor(id) + 30);
            
VipUsed[id] = true;
            
            
client_printc(id"%s Ti izbra !g30 Hp!n + !g30 Armor!n"PREFIX);
        }
        case 
2:
        {
            
give_item(id,"weapon_hegrenade");
            
give_item(id,"weapon_flashbang");
            
give_item(id,"weapon_flashbang");
            
give_item(id,"weapon_smokegrenade");
            
            
VipUsed[id] = true;
            
            
client_printc(id"%s Ti izbra !gVsichki Granati"PREFIX);
        }
        
         
        case 
3
        { 
            
       
set_user_gravity(id 300.0);
  
            
VipUsed[id] = true;

            
client_printc(id"%s Ti izbra !gGravity"PREFIX); 
        } 
            
              case 
4
        {
    
            
set_user_maxspeed(idfast_speed);
            
VipUsed[id] = true;
            
HasSpeed true;
            
            
client_printc(id"%s Ti izbra !gSpeed!n"PREFIX);
   } 
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
VipTMenu(id)
{
    new 
menu menu_create("\yVIP Menu \r(TR):^n""VipTMenu_handler");

    
menu_additem(menu"\w30 HP + 30 Amrmor""1"0);
    
menu_additem(menu"\wAll Grenades""2"0);
    
menu_additem(menu"\wGravity""3"0);
    
menu_additem(menu"\wSpeed""4"0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
VipTMenu_handler(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 
1:
        {
            
set_user_health(idget_user_health(id) + 30);
            
set_user_armor(idget_user_armor(id) + 30);
            
VipUsed[id] = true;
            
            
client_printc(id"%s Ti izbra !g30 Hp!n + !g30 Armor!n"PREFIX);
        }
        case 
2:
        {
         
give_item(id,"weapon_hegrenade");
         
give_item(id,"weapon_flashbang");
    
give_item(id,"weapon_flashbang");
         
give_item(id,"weapon_smokegrenade");
            
            
VipUsed[id] = true;
            
            
client_printc(id"%s Ti izbra !gVsichki Granati"PREFIX);
        }
        
         
        case 
3
        { 
               
            
set_user_gravity(id300);
  
            
VipUsed[id] = true

            
client_printc(id"%s Ti izbra !gGravity"PREFIX); 
        } 
            
              case 
4
        {
    
            
set_user_maxspeed(idfast_speed);
            
VipUsed[id] = true;
            
HasSpeed true;
            
            
client_printc(id"%s Ti izbra !gSpeed!n"PREFIX);
   } 
    }

    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

Sorry for my english!

Last edited by Flick3rR; 03-03-2014 at 15:17.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
 



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 05:57.


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