Redefining functions
#1

Hey, im wondering... is it possible to redefine functions ?
Something like this:

pawn Код:
#include <a_samp>

//Renaming Ban to _INCLUDE_ban
#define _INCLUDE_ban Ban
//redefining Ban to another function
#define Ban(%0) CallLocalFunction("OnPlayerGetBanned","i",%0);_INCLUDE_ban(%0)

public OnPlayerConnect(playerid)
{
    Ban(playerid); //testing
    return 1;
}

forward OnPlayerGetBanned(playerid);
public OnPlayerGetBanned(playerid)
{
    return 1;
}
Only this seems to freeze the pawn compiler since it is doing a infinite loop (_INCLUDE_ban probably calls the function Ban again instead of the real one making it calling himself infinite times...)
Reply


Messages In This Thread
Redefining functions - by gamer931215 - 03.09.2011, 12:03
Re: Redefining functions - by Stylock - 03.09.2011, 12:21
Re: Redefining functions - by gamer931215 - 03.09.2011, 12:27

Forum Jump:


Users browsing this thread: 1 Guest(s)