SA-MP Forums Archive
How to create callback that handle returns? - 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: How to create callback that handle returns? (/showthread.php?tid=410189)



How to create callback that handle returns? - Plovix - 24.01.2013

Title says all...How?


Re: How to create callback that handle returns? - FUNExtreme - 24.01.2013

pawn Код:
return something;
Simple as that


Re: How to create callback that handle returns? - Patrick - 24.01.2013

example this

pawn Код:
forward Test();
public Test()
}
return Test;
}



Re: How to create callback that handle returns? - Plovix - 24.01.2013

Example: someone returns 0 to example callback,then server resets his money using ResetPlayerMoney function.
Can you create example callback,please?


Re: How to create callback that handle returns? - Patrick - 24.01.2013

pawn Код:
forward ResetMoney
public ResetMoney
{
//code here
return ResetPlayerMoney;
}
like this?


Re: How to create callback that handle returns? - Plovix - 24.01.2013

Quote:
Originally Posted by pds2012
Посмотреть сообщение
pawn Код:
forward ResetMoney
public ResetMoney
{
//code here
return ResetPlayerMoney;
}
like this?
No.I mean to use CallLocalFunction to call.And if the scripter returns 0 then that callback resets money(for example)
Sorry for my bad english


Re: How to create callback that handle returns? - gnoomen2 - 24.01.2013

Maybe this:

pawn Код:
forward ResetMoney(); // you may want to put "playerid" inside here.
public ResetMoney() // and here.
{
    // The code that you want to start - here.
}
COMMAND:resetmoney(playerid, params[])
{
    SetTimer("ResetMoney",2000,0); // Starts public ResetMoney after 2 seconds ( 2000 milliseconds) ,0 = not doing it again and again (,1 = repeat)
    return 1; // don't know if it is ResetMoney or ResetMoney(playerid) we should put in the timer.
}



Re: How to create callback that handle returns? - Plovix - 24.01.2013

Quote:
Originally Posted by gnoomen2
Посмотреть сообщение
Maybe this:

pawn Код:
forward ResetMoney(); // you may want to put "playerid" inside here.
public ResetMoney() // and here.
{
    // The code that you want to start - here.
}
COMMAND:resetmoney(playerid, params[])
{
    SetTimer("ResetMoney",2000,0); // Starts public ResetMoney after 2 seconds ( 2000 milliseconds) ,0 = not doing it again and again (,1 = repeat)
    return 1; // don't know if it is ResetMoney or ResetMoney(playerid) we should put in the timer.
}
NO!I know how to call function.Please READ my queston before answering.
For example again: If you don't return value on that created callback,then warning shows:
"MyCallback should return value"
I need ansfwer how to create callback like that.Where value must be returned.
Is there anyone who can UNDERSTAND my question!?


Re: How to create callback that handle returns? - FUNExtreme - 24.01.2013

Quote:
Originally Posted by Plovix
Посмотреть сообщение
NO!I know how to call function.Please READ my queston before answering.
For example again: If you don't return value on that created callback,then warning shows:
"MyCallback should return value"
I need ansfwer how to create callback like that.Where value must be returned.
Is there anyone who can UNDERSTAND my question!?
What you are saying makes no sense at all. You could try giving an example.


Re: How to create callback that handle returns? - Sime30 - 24.01.2013

Plovix, daj barem reci na na naљem jeziku, moћda te tako budem razumio!