Raised This Month: $ Target: $400
 0% 

Gravity --'


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Monster Truck
Member
Join Date: Jan 2012
Location: France
Old 01-02-2014 , 08:00   Re: Gravity --'
Reply With Quote #1

I don't get it, what do you mean by call ? I don't need to ?

Because it's working for speed, why not for gravity ?
Monster Truck is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-02-2014 , 09:12   Re: Gravity --'
Reply With Quote #2

Just an example:

This function:
PHP Code:
public race(id)
{
    new 
menu menu_create("Choisis Ta classe de Garde :""furien_menu")
    
menu_additem(menu"\wMilitaire \y- \w[ \rM4 \w+ \rDeagle \w]""1")
    
menu_additem(menu"\wSniper \y- \w[ \rAwp \w+ \rDeagle \w]""2")
    
menu_additem(menu"\wMarine \y- \w[ \rMitrailleuse \w+ \rUsp \w]""3")
    
menu_additem(menu"\wGarde \y- \w[ \rAk47 \w+ \rDeagle \w+ \rFlash \w]""4")
    
menu_setprop(menuMPROP_EXITNAME"Quitter")
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu)

is called by:

PHP Code:
case CS_TEAM_Tterro(id); 
You must do the same for the function that didn't work
__________________
What are you looking for here?
DavidJr is offline
Monster Truck
Member
Join Date: Jan 2012
Location: France
Old 01-02-2014 , 09:26   Re: Gravity --'
Reply With Quote #3

As a beginner in scripting, i don't know how. I'm pretty sure u didn't get the objectiv of this plugin, because in my mind i don't have to call it, considering that this last function do not really impact on the plugin, it's an extra stuff that handle another plugin ... to reset speed and gravity when it stills only 1 terror.

If i need to call, i really don't how in that case.

Sorry, i'm a noob :/

Last edited by Monster Truck; 01-02-2014 at 09:27.
Monster Truck is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-02-2014 , 09:18   Re: Gravity --'
Reply With Quote #4

Just an example:

This function:
PHP Code:
public race(id)
{
    new 
menu menu_create("Choisis Ta classe de Garde :""furien_menu")
    
menu_additem(menu"\wMilitaire \y- \w[ \rM4 \w+ \rDeagle \w]""1")
    
menu_additem(menu"\wSniper \y- \w[ \rAwp \w+ \rDeagle \w]""2")
    
menu_additem(menu"\wMarine \y- \w[ \rMitrailleuse \w+ \rUsp \w]""3")
    
menu_additem(menu"\wGarde \y- \w[ \rAk47 \w+ \rDeagle \w+ \rFlash \w]""4")
    
menu_setprop(menuMPROP_EXITNAME"Quitter")
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu)

is called by:

PHP Code:
case CS_TEAM_Tterro(id); 
You must do the same for the function that didn't work
__________________
What are you looking for here?
DavidJr is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-02-2014 , 09:32   Re: Gravity --'
Reply With Quote #5

You want to reset the gravity when there's only 1 terrorist left?


This will set normal gravity when there's only 1 terrorist left
PHP Code:
set_task (2.0"check_players_left"___,"b"//in init

public check_players_left()
{
    new 
players[32], numplayer
    get_players
(playersnum"ae""TERRORIST")
    
    for (new 
total i++) 
    {
        
player players[i]
        if (
num == 1)
        {
            
set_user_gravity(player)
        }
    }

__________________
What are you looking for here?

Last edited by DavidJr; 01-02-2014 at 11:04.
DavidJr is offline
Monster Truck
Member
Join Date: Jan 2012
Location: France
Old 01-02-2014 , 10:47   Re: Gravity --'
Reply With Quote #6

Quote:
Originally Posted by DavidJr View Post
You want to reset the gravity when there's only 1 terrorist left?


This will set normal gravity when there's only 1 terrorist left
PHP Code:
set_task (2.0"check_players_left"___,"b"//in init

public check_players_left()
{
    new 
players[32], numplayer
    get_players
(playersnum"ae""TERRORIST")
    
    for (new 
total i++) 
    {
        if (
num == 1)
        {
            
set_user_gravity(id)
        }
    }

When i compile it wrote undefined id, undefined total. So, i puted them into
public check_players_left() ---> public check_players_left(id, total).

Then, i have an error, symbol is never used "player". I dont want to change something else, i'm not sure what's wrong in it.

Anyway, thanks so much for helping me
Monster Truck is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 01-02-2014 , 11:38   Re: Gravity --'
Reply With Quote #7

Should be:
PHP Code:
set_task (2.0"check_players_left"___,"b"//put in plugin_init

public check_players_left()
{
    new 
players[32], numplayer
    get_players
(playersnum"ae""TERRORIST")
    if( 
num == )
    {
        
player players[0]
        
set_user_gravity(player1.0)
        
ExecuteHam(Ham_Item_PreFrameplayer// reset maxspeed
    
}

@Monster Truck
What exactly you want to do?
If you don't know how to use functions, you should learn more the basic knowledge of scripting.
There are a lot of tutorials you can find, which can increase your knowledge.
__________________
youtube:
@holla16

Last edited by 11922911; 01-02-2014 at 14:51.
11922911 is offline
Monster Truck
Member
Join Date: Jan 2012
Location: France
Old 01-02-2014 , 11:49   Re: Gravity --'
Reply With Quote #8

Undefined symbol "total" for DavidJr

and no errors but it won't work for 11922911.

Thanks a lot for your help. Maybe you can try fix it DavidJr ? Thank you again
Monster Truck is offline
DavidJr
Senior Member
Join Date: Apr 2012
Old 01-02-2014 , 11:05   Re: Gravity --'
Reply With Quote #9

Check again my post, I've fixed it
__________________
What are you looking for here?
DavidJr is offline
11922911
Senior Member
Join Date: Dec 2011
Location: Yuen Long Country
Old 01-02-2014 , 12:04   Re: Gravity --'
Reply With Quote #10

Something I want to know, Is that your full code that you gave? or you have skipped something?
__________________
youtube:
@holla16

Last edited by 11922911; 01-02-2014 at 12:12.
11922911 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 10:09.


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