Raised This Month: $ Target: $400
 0% 

Compile Error ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 07-10-2014 , 18:57   Re: Compile Error ?
Reply With Quote #1

I do not understand why we have to do a check if the player lives that you are using spawn, he still comes back to life.
Take a check:
PHP Code:
/* Plugin generated by AMXX-Studio */

#include < amxmodx >
#include < hamsandwich >

enum _:gMenu
{
    
NAME[32],
    
ACTION[32]
};

new const 
gMenu_cmds[] [gMenu] = {
    { 
"Buy Menu""say /buy" }

};

public 
plugin_init(){
    
register_plugin("","1.0","");    
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)    
    
register_clcmd("say /menu","cmd_menu");
}


public 
cmd_menu(client){
    
    new 
menu_create("Your Menu :-","mHandler");

    for (new 
isizeof gMenu_cmdsi++)
    
menu_additem(m,gMenu_cmds[i][NAME]);
    
    
menu_display(client,m);
}

public 
mHandler(client,m,item)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(m)        
        return 
PLUGIN_HANDLED;
    }
    else
    {
        
client_cmd(client,"%s",gMenu_cmds[item][ACTION]);
        
cmd_menu(client);
    }

    return 
PLUGIN_HANDLED;
}

public 
fwHamPlayerSpawnPost(iPlayer)
{
    
cmd_menuiPlayer )

Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
wickedd
Veteran Member
Join Date: Nov 2009
Old 07-10-2014 , 19:12   Re: Compile Error ?
Reply With Quote #2

Quote:
Originally Posted by Fuck For Fun View Post
I do not understand why we have to do a check if the player lives that you are using spawn, he still comes back to life.
Because spawn is called once when a player joins the server. So the code you posted will have errors.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 07-10-2014 , 20:02   Re: Compile Error ?
Reply With Quote #3

Quote:
Originally Posted by wickedd View Post
Because spawn is called once when a player joins the server. So the code you posted will have errors.
I understand you, well I have not received ERROR

But I tested it and it works, so do his own testing, if the player lives

GL )
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-10-2014 , 21:45   Re: Compile Error ?
Reply With Quote #4

Quote:
Originally Posted by Fuck For Fun View Post
I understand you, well I have not received ERROR

But I tested it and it works, so do his own testing, if the player lives

GL )
It depends on the code that is being executed. It is a good habit to do it correctly every time regardless if it just so happens to give an error when you don't do it correctly.
__________________
fysiks 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 21:09.


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