AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Server crashing on MENU command (https://forums.alliedmods.net/showthread.php?t=95900)

malec321 06-28-2009 14:15

[HELP] Server crashing on MENU command
 
Grr this is pissing me off. Can anyone explain why everytime i type /xp the server crashes and the menu doesnt show.


PHP Code:

public cmdPmenuid )
{
if ( ( 
is_user_alive id ) ) && ( get_pcvar_num pCvarEnabled ) ) )
{
set_task1.0"Pmenu" )
}
else if ( !
is_user_alive id ) )
{
client_print idprint_chat"%s You are dead"PREFIX )
}
else
{
client_print idprint_chat"%s Plugin is disabled"PREFIX )
}
}

public 
Pmenuid )
{
new 
menu menu_create "/rHide N Seek XP""P_Menu" )

menu_additem menu"\rGrenade \yMenu \r(Terrorist)""1")
menu_additem menu"\rHealth \yMenu""2")
menu_additem menu"\rArmor \yMenu" "3")
menu_additem menu"\rShop \yMenu""4")
menu_additem menu"\rBuy \yXP""5")
menu_additem menu"\rRevive - \y50 points""6")

menu_setprop menuMPROP_EXITMEXIT_NEVER );
menu_display (idmenu


crazyeffect 06-28-2009 14:27

Re: [HELP] Server crashing on MENU command
 
Whole file please

Also give us the error...

This will work too

PHP Code:

if ( is_user_alive id ) && get_pcvar_num pCvarEnabled ) ) 

For the rest looks everything normal to me...

malec321 06-28-2009 14:59

Re: [HELP] Server crashing on MENU command
 
Its just the MAIN menu all the other functions work of the plugin like /myxp

malec321 06-28-2009 15:01

Re: [HELP] Server crashing on MENU command
 
set_task( 1.0, "Pmenu" )

doesnt it have to be

set_task( 1.0, "P_menu" )

DarkGod 06-28-2009 15:17

Re: [HELP] Server crashing on MENU command
 
Code:
set_task( 1.0, "Pmenu", id )

That way it would only open it on the person who says it instead of everyone at once (I think, anyway, I suck at scripting).

fysiks 06-28-2009 16:03

Re: [HELP] Server crashing on MENU command
 
Don't use a task. Just call the function.

PHP Code:

Pmenu(id



All times are GMT -4. The time now is 15:26.

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