How to make an include?
#1

Helo! i make an simple include to test something and i have a error
PHP Code:
#if defined _admin_included
    #endinput
#endif
#define _admin_included
 
#tryinclude <a_samp>
public OnPlayerConnect(playerid)
{
    
SendClientMessage(playerid, -1"Helo bro");
    return 
1;

I get this error in my gamemode, the include is included with #include <admin>
PHP Code:
C:\Users\Calinacho\Desktop\server  samp\gamemodes\test.pwn(244) : error 021symbol already defined"SSCANF_OnPlayerConnect" 
Reply
#2

You need to hook OnPlayerConnect function.
Reply
#3

Quote:
Originally Posted by DRIFT_HUNTER
View Post
You need to hook OnPlayerConnect function.
How to make that? I'm new in this include
Reply
#4

Quote:
Originally Posted by Calinut200
View Post
How to make that? I'm new in this include
Take a look here:
https://sampforum.blast.hk/showthread.php?tid=574534

Here's a simple example of a callback hook:

PHP Code:
public OnPlayerConnect(playerid)
{
    
#if defined MyLib_OnPlayerConnect
        
MyLib_OnPlayerConnect(playerid);
    
#endif
    
return 1;
}
#if defined _ALS_OnPlayerConnect
    #undef OnPlayerConnect
#else
    #define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect MyLib_OnPlayerConnect
#if defined MyLib_OnPlayerConnect
    
forward MyLib_OnPlayerConnect(playerid);
#endif 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)