[FilterScript] New Handles for Vehicles - 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: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] New Handles for Vehicles (
/showthread.php?tid=394618)
New Handles for Vehicles -
Amora187 - 23.11.2012
This is a new handles filterscript for vehicles, You can use it by /handles and here is the code:
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
new VehicleHandles[MAX_VEHICLES];
new HandleTime[MAX_VEHICLES];
new Float:v[4];
stock GetPlayerSpeed(playerid, bool:kmh)
{
new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
if(IsPlayerInAnyVehicle(playerid)) GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz);
else GetPlayerVelocity(playerid,Vx,Vy,Vz);
rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Vehicle Handles FS scripted by Amora187");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
for(new i; i<MAX_VEHICLES; i++)
{
KillTimer(HandleTime[i]);
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/handles", cmdtext, true, 10) == 0)
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid)==0)
{
new vid=GetPlayerVehicleID(playerid);
switch(VehicleHandles[vid])
{
case 0:
{
if(GetPlayerSpeed(playerid,true)==0)
{
VehicleHandles[vid]=1;
GetVehiclePos(vid,v[0],v[1],v[2]);
GetVehicleZAngle(vid,v[3]);
HandleTime[vid]=SetTimerEx("HandlesTimer",1,1,"i",vid);
SendClientMessage(playerid,0xFFFFFFFF,"Vehicle Handles Turned ON!");
}else
{
SendClientMessage(playerid,0xAA3333AA,"You cannot handle the vehicle while not on ground or not stoped!");
}
}
case 1:
{
VehicleHandles[vid]=0;
KillTimer(HandleTime[vid]);
SendClientMessage(playerid,0xFFFFFFFF,"Vehicle Handles Turned OFF!");
}
}
}
return 1;
}
return 0;
}
forward HandlesTimer(vehicleid);
public HandlesTimer(vehicleid)
{
switch(VehicleHandles[vehicleid])
{
case 0:
{
KillTimer(HandleTime[vehicleid]);
}
case 1:
{
SetVehiclePos(vehicleid,v[0],v[1],v[2]);
SetVehicleZAngle(vehicleid,v[3]);
}
}
}
How is it? Reply Please!!!!
Re: New Handles for Vehicles -
[E]ViL [D]RaGoN™ - 23.11.2012
Well, Nice
Re: New Handles for Vehicles -
~Yafar~ - 23.11.2012
any pics
Re: New Handles for Vehicles -
Amora187 - 23.11.2012
It doesnt need pictures as the vehicle is in the same position while its handled
Re: New Handles for Vehicles -
ashwinsekhari - 23.11.2012
please add pics!! please i will use it then only even one pic also work
Re: New Handles for Vehicles -
Amora187 - 23.11.2012
How to host a picture? Link please
Re: New Handles for Vehicles -
AirKite - 23.11.2012
Bad way...