SA-MP Forums Archive
ANTI-TELEPORT TROLL - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: ANTI-TELEPORT TROLL (/showthread.php?tid=605454)



ANTI-TELEPORT TROLL - Nin9r - 19.04.2016

Who knows a method to block trolling, vehicle spawner / teleport..
I am using this":


Код HTML:
public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat)
{
        new string[128], Float:vpos_x, Float:vpos_y, Float:vpos_z, Float:vpos_a;
        GetVehiclePos(vehicleid, vpos_x, vpos_y, vpos_z); GetVehicleZAngle(vehicleid,vpos_a);
        if(OldVehiclePos[vehicleid][0] != 0.0 && OldVehiclePos[vehicleid][1] != 0.0 && OldVehiclePos[vehicleid][2] != 0.0 && OldVehiclePos[vehicleid][3] != 0.0)
        {
			if(PlayerData[playerid][pPremium] == 0)
			{
			    if(PlayerData[playerid][pAdmin] == 0)
				{
	                new Float:vehicledistance = GetDistanceBetweenPoints(vpos_x, vpos_y, vpos_z, OldVehiclePos[vehicleid][0], OldVehiclePos[vehicleid][1], OldVehiclePos[vehicleid][2]);
	                //format(string, sizeof(string), "Update Distance: %f", vehicledistance);
	                //SendClientMessage(playerid, 0xFFFFFFFF, string);
	                if(vehicledistance > 15.0)
	                {
							SetVehicleVirtualWorld(vehicleid, 2);
	                       SetVehiclePos(vehicleid, OldVehiclePos[vehicleid][0], OldVehiclePos[vehicleid][1], OldVehiclePos[vehicleid][2]);
	                        SetVehicleZAngle(vehicleid,OldVehiclePos[vehicleid][3]);
	                        return;
	                }
				}
			}
        }
        OldVehiclePos[vehicleid][0]=vpos_x;
        OldVehiclePos[vehicleid][1]=vpos_y;
        OldVehiclePos[vehicleid][2]=vpos_z;
        OldVehiclePos[vehicleid][3]=vpos_a;
}
Even if i used the condition to allow premium or admin members to get a car, it is respawning anyway and it doesn't work properly. Any method please?