ANTI-CHEAT (GetPlayerVirtualWorld)
#1

Well, I'm making a minigame with miniguns, but the anti-cheat would ban them for having that. I tried to add one thing (with GetPlayerVirtualWorld), but I had errors. The minigame is at virtual world 4 and 15. So, can you help me and allow the minigun on these virtual worlds?

Script of that:

Код:
    #if defined ANTI_MINIGUN
    new weap, ammo;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && PlayerInfo[i][Level] == 0)
        {
            GetPlayerWeaponData(i, 7, weap, ammo);
            if(ammo > 1 && weap == 38) {
                new string[128]; format(string,sizeof(string),"ANTICHEAT: %s has been automatically banned for spawning Minigun with %d ammo", PlayerName2(i), ammo);
                SendClientMessageToAll(red,string);
                Ban(i);
            }
        }
    }
    #endif
Reply
#2

well there is a tutorial when you teleport to a dm place it sets dmplace = 1 then on your anticheat put
if dmplace = 1 then return 0
else ban(i)
btw hi libra
Reply
#3

Hey.

But there's no only one DM place (minigame), there's over 20 (with Rocket Lanuchers and other).
Reply
#4

well still you can use it figure it out xD
here https://sampforum.blast.hk/showthread.php?tid=176688
Reply
#5

try somethin like this..
Quote:

#if defined ANTI_MINIGUN
new weap, ammo;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][Level] == 0)
{
if(IsPlayerInMiniGame[playerid] == 1) return//
GetPlayerWeaponData(i, 7, weap, ammo);
if(ammo > 1 && weap == 3 {
if
new string[128]; format(string,sizeof(string),"ANTICHEAT: %s has been automatically banned for spawning Minigun with %d ammo", PlayerName2(i), ammo);
SendClientMessageToAll(red,string);
Ban(i);
}
}
}
#endif

Reply
#6

Well, it cannot be IsPlayerInMiniGame, because there are some places (like 24/7 shops), when you enter, your virtual world changing...
Reply
#7

That IsPlayerInMiniGame i use..dont know what you do
Reply
#8

just something like

if(GetPlayerVirtualWorld(i) < 8 || > 14) return

For example
Reply
#9

pawn Код:
if(GetPlayerVirtualWorld(playerid) != 4 && GetPlayerVirtualWorld(playerid) != 15)
Reply
#10

Ty, Garsino, works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)