prevent NPCs from continuing with OnPlayerSpawn

This commit is contained in:
Lorenc Pekaj 2018-10-22 00:32:10 +11:00
parent 98941bbc7f
commit a64c916637
2 changed files with 7 additions and 2 deletions

View File

@ -246,6 +246,11 @@ hook OnScriptInit( )
hook OnPlayerSpawn( playerid )
{
// prevent npcs from being treated like players
if ( IsPlayerNPC( playerid ) ) {
return Y_HOOKS_BREAK_RETURN_1; // add a callback otherwise OnNpcSpawn
}
// check if this spawn is even approved
if ( ! IsPlayerClassApproved( playerid ) )
{

View File

@ -205,13 +205,13 @@ hook OnPlayerUpdate( playerid )
return Y_HOOKS_CONTINUE_RETURN_1;
}
hook OnPlayerSpawn( playerid )
/*hook OnPlayerSpawn( playerid )
{
if ( IsPlayerSecurityDriver( playerid ) ) {
return Y_HOOKS_BREAK_RETURN_1;
}
return Y_HOOKS_CONTINUE_RETURN_1;
}
}*/
hook OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float: fX, Float: fY, Float: fZ )
{