Raised This Month: $32 Target: $400
 8% 

My first natives


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LordOfNothing
BANNED
Join Date: Jul 2013
Old 11-16-2013 , 03:08   My first natives
Reply With Quote #1

Hello , i try to write 2 natives , enable_Godmode(id) , disable_Godmode(id) .... is something wrong ?

PHP Code:
// example :

  
enable_godmode(id);

static 
cell AMX_NATIVE_CALL enable_godmode(AMX *amx)
{
   
    
CHECK_PLAYER(params[1]);
  
    
edict_t *pPlayer MF_GetPlayerEdict(params[1]);

    
pPlayer->v.takedamage 0.0;
    
    return 
1;
}


// example :

  
disable_godmode(id);

static 
cell AMX_NATIVE_CALL disable_godmode(AMX *amx)
{
   
    
CHECK_PLAYER(params[1]);
  
    
edict_t *pPlayer MF_GetPlayerEdict(params[1]);

    
pPlayer->v.takedamage 2.0;
    
    return 
1;

LordOfNothing is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 11-16-2013 , 06:12   Re: My first natives
Reply With Quote #2

Press F9.
__________________
micapat is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 11-16-2013 , 09:45   Re: My first natives
Reply With Quote #3

Look the fun module source code.
__________________
kiki33hun is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-16-2013 , 11:59   Re: My first natives
Reply With Quote #4

Quote:
Originally Posted by kiki33hun View Post
Look the fun module source code.
That's what he did, else code would looks like something else.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 11-17-2013, 02:57
LordOfNothing
This message has been deleted by LordOfNothing.
LordOfNothing
BANNED
Join Date: Jul 2013
Old 11-17-2013 , 09:32   Re: My first natives
Reply With Quote #5

how i can register a chat command in a module ??
LordOfNothing is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-23-2013 , 03:01   Re: My first natives
Reply With Quote #6

It won't compile, params parameter is not defined. Also, amx parameter is never used.

Quote:
Originally Posted by LordOfNothing View Post
how i can register a chat command in a module ??
Hooking ClientCommand forward. If you want to make sure it is a chat command, make sure the command is say or say_team.
__________________

Last edited by claudiuhks; 11-23-2013 at 03:05.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
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 19:14.


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