Hook/Local? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Hook/Local? (
/showthread.php?tid=617956)
Hook/Local? -
CannonBolt - 29.09.2016
How do i call a callback in another callback? what should i use?
Re: Hook/Local? -
Crayder - 29.09.2016
Perhaps you should explain a bit more... This is valid:
pawn Код:
public callback1() {
return 72;
}
public callback2() {
callback1();
return 1;
}
In that, I called callback1 in callback2. I assume this is what you mean?
Re: Hook/Local? -
CannonBolt - 29.09.2016
Quote:
Originally Posted by Crayder
Perhaps you should explain a bit more... This is valid:
pawn Код:
public callback1() { return 72; } public callback2() { callback1(); return 1; }
In that, I called callback1 in callback2. I assume this is what you mean?
|
Yes. but when i call for example
Код:
public OnPlayerRequestClass(playerid, classid)
in another callback it says undefine symbol classid i'm trying to use it with the classid thats why
Re: Hook/Local? -
Dayrion - 29.09.2016
Show your code.
If you want to call OnPlayerRequestClass in another callback, this might be (example):
PHP код:
public randomcall(playerid)
{
blabla
OnPlayerRequestClass(playerid, CLASS_SWAT);
return 1;
}
Re: Hook/Local? -
CannonBolt - 29.09.2016
Quote:
Originally Posted by Dayrion
Show your code.
If you want to call OnPlayerRequestClass in another callback, this might be (example):
PHP код:
public randomcall(playerid)
{
blabla
OnPlayerRequestClass(playerid, CLASS_SWAT);
return 1;
}
|
Tag Mismatch.
Re: Hook/Local? -
Dayrion - 29.09.2016
Quote:
Originally Posted by Dayrion
Show your code.
|
Because your classid isn't a integer.
Re: Hook/Local? -
CannonBolt - 29.09.2016
Quote:
Originally Posted by Dayrion
Because your classid isn't a integer.
|
Notice but still doesn't work
Код:
OnPlayerRequestClass(playerid, 270);
Re: Hook/Local? -
Dayrion - 29.09.2016
Show the whole code.