Closed MeFFoS closed 6 years ago
As far as I know, those callbacks are called only in scripts placed in npcmodes
. sampGDK catches only callbacks that are called in the gamemode, not sure. But yeah, this should be addressed somehow, maybe an overload for every callback to also include the AMX pointer as an argument before the rest of callback's arguments, if possible. Maybe this plugin should also register some AMX native to help us to identify each script's pointer if overloads like those would be made.
An example using OnPlayerConnect
, sampGDK should declare two callbacks:
The regular
int OnPlayerConnect( int playerid );
and an overload
int OnPlayerConnect( AMX * amx, int playerid );
or maybe have this available only in OnPublicCall
? :man_shrugging:
Also, the function to be called from every script could look like
native GDK_PingScript( name[ ] );
which could be used like
// in GM:
public OnGameModeInit( )
{
GDK_PingScript( "gamemode" );
}
// in some FS:
public OnFilterScriptInit( )
{
GDK_PingScript( "my_first_fs" );
}
and some
void OnScriptPing( AMX * amx, const char name[ ] );
could be called by the sampGDK in the plugin.
Have not NPC callbacks: NPC:OnClientMessage NPC:OnPlayerDeath NPC:OnPlayerStreamIn NPC:OnPlayerStreamOut NPC:OnPlayerText NPC:OnRecordingPlaybackEnd NPC:OnVehicleStreamIn NPC:OnVehicleStreamOut http://wiki.sa-mp.com/wiki/Category:Scripting_Callbacks