How to do it?
#1

I'm working on anti-hack

Now I do not want to for do any "anti-cheat" new public

i want they be like this:
PHP код:
public OnPlayerDetectedCheat(playeridcheatid)
{
    if(
cheatid == ANTI_MONEY// (cheatid 1)
    
{
        
// 
    
}
    if(
cheatid == ANTI_WEAPON// (cheatid 2)
    
{
        
//
    
}
    return 
0;

want one of everything Public.

Do not want to do so:
PHP код:
public OnPlayerFakeMoney(playerid)
{
    return 
0;

PHP код:
public OnPlayerFakeWeapon(playerid)
{
    return 
0;

I believe you understand me, I'd be happy if you explain to me how to do it

( sorry my bad english )
Reply
#2

You can use CallLocalFunction to call a custom callback, assuming your calling a local script(example: the script is part of a gamemode / in as an include).

See:
https://sampwiki.blast.hk/wiki/CallLocalFunction

Using https://sampwiki.blast.hk/wiki/CallRemoteFunction will call the function in any loaded scripts the server is running.
Reply
#3

Quote:
Originally Posted by Abagail
Посмотреть сообщение
You can use CallLocalFunction to call a custom callback, assuming your calling a local script(example: the script is part of a gamemode / in as an include).

See:
https://sampwiki.blast.hk/wiki/CallLocalFunction

Using https://sampwiki.blast.hk/wiki/CallRemoteFunction will call the function in any loaded scripts the server is running.
Can be an example of how to do what I asked?

You can make me an example code?

If I knew I would do
Reply
#4

Oh I thought you wanted it the other way around. You can still use that function how-ever, and do something like this:

pawn Код:
// when CASE_MONEY gets detected:
CallLocalFunction("OnPlayerDetectedCheat", "id", playerid, CHEAT_MONEY);
This will call the function with these parameters:
OnPlayerDetectedCheat(playerid, CHEAT_MONEY);
Reply
#5

Quote:
Originally Posted by Abagail
Посмотреть сообщение
Oh I thought you wanted it the other way around. You can still use that function how-ever, and do something like this:

pawn Код:
// when CASE_MONEY gets detected:
CallLocalFunction("OnPlayerDetectedCheat", "id", playerid, CHEAT_MONEY);
This will call the function with these parameters:
OnPlayerDetectedCheat(playerid, CHEAT_MONEY);
Enable the full code please?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)