Raised This Month: $ Target: $400
 0% 

Scripting Question(MySql)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-19-2014 , 13:54   Re: Scripting Question(MySql)
Reply With Quote #10

In order to make an entity you have to do something like this.

PHP Code:
#include < amxmodx >
#include < fakemeta >
#include < engine >

new const ClassName[ ] = "SaveDataFix" /*this will be the entity class name*/

public plugin_init ( ) {

    new 
iEntity
    iEntity 
create_entity "info_target" )
    
set_peviEntitypev_classnameClassName );
    
set_peviEntitypev_nextthinkget_gametime(  ) + 0.3 );
    
register_forwardFM_Think"fm_Think" );
    
    
}

public 
fm_Think iEntity ) {

    if ( ! 
pev_valid iEntity ) ) // check if ent is invalid
        
return; //if so stop the function
        
    
set_peviEntpev_nextthinkget_gametime(  ) + 1.0 //set a new think    
    
    /*
    
    your block of code that the entity will do
    
    */



Last edited by HamletEagle; 05-20-2014 at 08:43.
HamletEagle is offline
 



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 09:43.


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