SA-MP Forums Archive
Need help - 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)
+--- Thread: Need help (/showthread.php?tid=571724)



Need help - lanix - 21.04.2015

need help,I have failed on this script can someone help me
Код:
 if(IsPlayerInAnyVehicle(playerid))
     	{
     	    if(GetVehicleSpeed(playerid) > 200)
     	    {
     	        TogglePlayerControllable(playerid, false);
                SetPlayerPos(playerid, 1941.1534,-1100.2391,-23.7885);
                ShowPlayerDialog(playerid, DIALOG_PRAVILA,DIALOG_STYLE_MSGBOX,"Anti-Hack", "{FFCC00}[Anticheat]"WHITE"[Anti-Cheat] You Have Been Banned for using Speed	Hack!!!","Ok","");
                BanEx(playerid, "Speed Hack");
			}
		}
Код:
stock GetVehicleSpeed(playerid)
{
    new Float:ST[4];
    if(IsPlayerInAnyVehicle(playerid))
    GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
    else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
    ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 178.8617875;
    return floatround(ST[3]);
}



Re: Need help - Fel486 - 21.04.2015

On my own include, I use this method:

PHP код:
stock Float:getPlayerSpeed(playerid)
{
    new 
Float:xFloat:yFloat:z;
    if(
IsPlayerInAnyVehicle(playerid))
    {
        
GetVehicleVelocity(GetPlayerVehicleID(playerid), xyz);
        return (
floatsqroot(z) * 180.00);
    }
    
    return 
0.0;

and works.


Re: Need help - lanix - 21.04.2015

Thx,You help me today about this: https://sampforum.blast.hk/showthread.php?tid=571710
and now about this +REP