return 1 or return 0?
#1

So, Do I have to use return 1 or return 0 here?

pawn Код:
public OnPlayerText(playerid, text[])
{
    new name[24], string[128], string2[128];
    GetPlayerName(playerid, name, 24);
    if(ison911[playerid] != 1)
    {
    format(string, sizeof(string), "%s Says: %s", name, text);
    ProxDetector(10.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    }
    if(ison911[playerid] == 1)
    {
        foreach(Player, i)
        {
            format(string2, sizeof(string2), "[911 CALL]%d: %s", PlayerInfo[playerid][PhoneNumber], text);
            if(PlayerInfo[i][Fmember] == 1 || PlayerInfo[i][Fmember] == 2 || PlayerInfo[i][Fmember] == 3 || PlayerInfo[i][Fmember] == 4) SendClientMessage(i, COLOR_PINK, string2);
            format(string, sizeof(string), "(Phone)%s Says: %s", name, text);
            ProxDetector(10.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
        }
    }
    return 0;
}
Reply
#2

Return 1 will make the original text come through, return 0 won't. Hard to understand? I think not.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
Return 1 will make the original text come through, return 0 won't. Hard to understand? I think not.
1th: thanks,

2th: What is your reason to be full of anger against me? I noticed this on more posts.
Reply
#4

if its the gamemode, a return 1; will do fine, as vince stated. (return 1; sends a "succes. all fine. abort excecution).
if you're using it as filterscript, remove the return 0/1 in order to let the (failed) text pass to the next scripts' callback. (no aborting at all, compiler will complain, ignore that).
if you want a filterscript to fuck up the gamemodes' onplayertext (not passing scripts until the gamemode script can catch the text), then return 1; in a filterscript.

to all who want to rage coz "you NEED to return something in that callback blablabla", go try it yourself, or keep your mouth shut, iam abusing this trick in >4 (loaded together) filterscripts yet, without ANY problems +++
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)