Help Me - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help Me (
/showthread.php?tid=78051)
Help Me -
GanG$Ta - 16.05.2009
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?
Re: Virtualworlds -
GanG$Ta - 17.05.2009
no idea?
Re: Help Me -
Think - 17.05.2009
well WHAT isnt working.
is he banning you @ connect or what.
Re: Help Me -
GanG$Ta - 17.05.2009
no, the detection doesnt work. if a player changes the virtualworld with a cheat he doesnt get banned.
Re: Help Me -
GanG$Ta - 17.05.2009
?
Re: Help Me -
Badger(new) - 17.05.2009
i couldn't really understand your code, but this is how I'd do it:
Under The defines
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;
}
Re: Help Me -
GanG$Ta - 17.05.2009
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.
Re: Help Me -
Badger(new) - 17.05.2009
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;