Help Me
#1

Im trying to detect if a player is switching with a cheat to different virtualworld then normally.
I know this sounds a bit odd because it doesnt happen much and doesnt disturb like other cheats but i hate it when cheaters can do what they wants that basicly what me disturbs.

This is what i got but i doesnt works:
Код:
Above Main:
___________
new SaveWorld[MAX_PLAYERS];


In OnFilterScriptInit:
________________________
SetTimer("Check",2500,1);

public Check()
{
for(new i; i < MAX_PLAYERS; i++)
{
if(SaveWorld[i] != GetPlayerVirtualWorld(i))
{
Ban(i);
}
}
return true;
}

public OnPlayerConnect(playerid)
{
SetPlayer_VirtualWorld(playerid,0);
return true;
}

At the end of the script:
____________________________
stock SetPlayer_VirtualWorld(playerid,worldid)
{
SetPlayerVirtualWorld(playerid,worldid);
worldid = SaveWorld[playerid];
}
Any Ideas? Or isnt there a any solution to detect it?
Reply
#2

no idea?
Reply
#3

well WHAT isnt working.
is he banning you @ connect or what.
Reply
#4

no, the detection doesnt work. if a player changes the virtualworld with a cheat he doesnt get banned.
Reply
#5

?
Reply
#6

i couldn't really understand your code, but this is how I'd do it:

Under The defines
pawn Код:
forward Virt();
Under OnFilterScriptInit or OnGameModeInit
pawn Код:
public OnFilterScriptInit()
{
    SetTimer("Virt",2500,0);
    return 1;
}
Any Place on the script, except inside other callbacks.
pawn Код:
public Virt()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if (GetPlayerVirtualWorld(i)!=0)return BanEx(i,"Virtual World Cheats");
        }
    }
    return 1;
}
Reply
#7

and what if i change the virtualworld via SetPlayerVirtualWorld?, thats why i used this method to save the worldid because i want that the detection notices that i changed the virtualworld.
Reply
#8

well then you could just have this before the forwards:

pawn Код:
new PlayerVirtual[MAX_PLAYERS];

And then when you change the virtual, just make PlayerVirtual= to the new virtual e.g.
pawn Код:
SetPlayerVirtual(playerid,1);
PlayerVirtual[playerid]=1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)