AlliedModders

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

Monster Truck 01-14-2014 14:54

Call fuctions
 
Hi, as a beginner in scripting, i don't even know some basics thing :(

Today (or tomorrow ^^') i want to know how to call a function when another one is finished.

Example :

PHP Code:

public race(id

   new 
menu menu_create("Choisis ta classe de Garde""ct_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


I want this menu to be showed when another function is finished, so i think i need a way to check
it (fuction finished)

Thanks for read, and for help.

YamiKaitou 01-14-2014 14:55

Re: Call fuctions
 
Simply call this function at the end of the other function

Monster Truck 01-14-2014 15:00

Re: Call fuctions
 
This is what i'm looking for, i don't know how to do it :( I can't even understand why i don't know how to :o

YamiKaitou 01-14-2014 15:03

Re: Call fuctions
 
Code:

public function1(id)
{
    // stuff
    function2(id);
}

public function2(id)
{
    // more stuff
}


This is basic stuff, please go read up on coding

Monster Truck 01-14-2014 15:06

Re: Call fuctions
 
Thanks, i only learned how to code with seeing a lot of source file, but i don't really know where to read to learn basc stuff, etc .. You'll be very gentle if you give me a website.

YamiKaitou 01-14-2014 15:07

Re: Call fuctions
 
Start learning how to search...
https://wiki.alliedmods.net/Category...ng_(AMX_Mod_X)

Monster Truck 01-14-2014 15:37

Re: Call fuctions
 
Thanks and sorry.


All times are GMT -4. The time now is 10:04.

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