SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 01/04/2020, 07:42 PM   #1
Calinut200
Big Clucker
 
Join Date: Jun 2016
Posts: 74
Reputation: 0
Default How to make an include?

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" 
Calinut200 is offline   Reply With Quote
Old 01/04/2020, 07:56 PM   #2
DRIFT_HUNTER
High-roller
 
Join Date: Oct 2009
Posts: 2,203
Reputation: 229
Default Re: How to make an include?

You need to hook OnPlayerConnect function.
DRIFT_HUNTER is offline   Reply With Quote
Old 01/04/2020, 07:59 PM   #3
Calinut200
Big Clucker
 
Join Date: Jun 2016
Posts: 74
Reputation: 0
Default Re: How to make an include?

Quote:
Originally Posted by DRIFT_HUNTER View Post
You need to hook OnPlayerConnect function.
How to make that? I'm new in this include
Calinut200 is offline   Reply With Quote
Old 01/04/2020, 08:12 PM   #4
rzrusu
Little Clucker
 
rzrusu's Avatar
 
Join Date: Mar 2020
Posts: 13
Reputation: 3
Default Re: How to make an include?

Quote:
Originally Posted by Calinut200 View Post
How to make that? I'm new in this include
Take a look here:
https://forum.sa-mp.com/showthread.php?t=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 
rzrusu is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can i make FS in Include ? dakata994 Scripting Help 10 23/10/2013 06:38 AM
How would you make a include? iHaze. Scripting Help 5 22/02/2013 05:15 PM
Include to make JaKe Elite Everything and Nothing 1 29/04/2012 06:43 AM
How to make an Include? Ehab1911 Scripting Help 6 08/10/2011 06:37 PM
How do I make an include? Georgelopez1 Help Archive 4 28/09/2010 07:40 AM


All times are GMT. The time now is 04:51 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.