Callback is failing to read after a timer.
#1

Title.

Код:
[debug] Run time error 10: "Native function failed"
[debug]  strins
[debug] AMX backtrace:
[debug] #0 00008728 in ?? (0, 18294628) from rp.amx
[debug] #1 000556f0 in public LoadLumberjack (0) from rp.amx
PHP код:
SetTimerEx("LoadLumberjack"2000false"i"playerid); 
PHP код:
        forward public LoadLumberjack(playerid);
        public 
LoadLumberjack(playerid) {
            if(
IsPlayerConnected(playerid)) {
                
TogglePlayerControllable(playeridtrue);
                
Character[playerid][cDeliverRoute] = 1;
                switch(
Character[playerid][cDeliverRoute]) {
                    case 
1: {
                        
SendClientHint(playerid"Drive to the Gas Station at Interstate 27 to deliver your packages.");
                        
SetPlayerCheckpoint(playerid, -1544.1644,-2740.0630,49.16005);
                        
Character[playerid][cCheckpoint] = CP_LUMBERJACK_CP1;
                    }
                }
            }
        } 
I do get unfreezed, but nothing else happens other than getting the crashdetector message.
Reply
#2

pawn Код:
forward public LoadLumberjack(playerid);
Do not use "public" here, just "forward"
Reply
#3

PHP код:
forward LoadLumberjack(playerid); 
Reply
#4

Quote:
Originally Posted by Misiur
Посмотреть сообщение
pawn Код:
forward public LoadLumberjack(playerid);
Do not use "public" here, just "forward"
That's not the problem.
https://sampforum.blast.hk/showthread.php?tid=359953


Quote:
Originally Posted by Primes007
Посмотреть сообщение
PHP код:
forward LoadLumberjack(playerid); 
You literally just reposted what Misiur said, well done.
Reply
#5

Quote:
Originally Posted by Misiur
Посмотреть сообщение
pawn Код:
forward public LoadLumberjack(playerid);
Do not use "public" here, just "forward"
Not the issue. I do the same and it works fine. I've read somewhere that it's actually better to do it that way, but I'd need to look it up.

Show definition for SendClientHint.
Reply
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
Not the issue. I do the same and it works fine. I've read somewhere that it's actually better to do it that way, but I'd need to look it up.

Show definition for SendClientHint.
PHP код:
stock SendClientHint(playeridmessage[]) {
        new 
text[144];
        
format(text144" * %s"message);
        
SendClientMessage(playerid0xC1D4C5FFtext);
    } 
Reply
#7

Where is strins?
Reply
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
Not the issue. I do the same and it works fine. I've read somewhere that it's actually better to do it that way, but I'd need to look it up.

Show definition for SendClientHint.
Quote:
Originally Posted by Slice
Today I learned the proper way to forward public functions is this:
pawn Код:
forward public OnSomethingHappen(a, b, c);
I've always done it without "public". The only difference, it seems, is it enforces some extra restrictions (such as not being able to assign default values).
-----
Comment out SendClientHint and see if crashdetect still gives you that error. Again, start debugging!
Reply
#9

Seems to me like eh.. it was a magical client error? Don't know how to describe it, since after restarting the server, it worked fantastic.

Thanks anyways for y'all trying to help me out, appreciate it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)