Car Hop - 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: Car Hop (
/showthread.php?tid=122832)
Car Hop -
stieben - 23.01.2010
Can anyone please make a code for me so my vehicle hops into the sky?
Re: Car Hop -
FireFox_ - 23.01.2010
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/carhop", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new Float:X, Float:Y, Float:Z;
GetVehicleVelocity(GetPlayerVehicleID(playerid), X,Y,Z);
SetVehicleVelocity(GetPlayerVehicleID(playerid), X,Y,Z+10);
return 1;
}
}
else
{
SendClientMessage(playerid, 0xFFFFF, "You are not in a vehicle");
return 1;
}
return 0;
}
The scrip hasent been tested. Hope it works
Re: Car Hop -
stieben - 23.01.2010
Thanks I will try it
Re: Car Hop -
stieben - 23.01.2010
Ok, it works, BUT my vehicle stops driving when I use it and then goes into the sky.
Is it possible to make my vehicle continue driving and then jumping?
Re: Car Hop -
FireFox_ - 23.01.2010
pawn Код:
forward CarHop(playerid); // On Top of your script
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/carhop", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetVehicleVelocity(GetPlayerVehicleID(playerid), 0, 0, 5.0);
SetTimer("CarHop", 5000, 1);
return 1;
}
}
else
{
SendClientMessage(playerid, 0xFFFFF, "You are not in a vehicle");
return 1;
}
return 0;
}
pawn Код:
public CarHop(playerid) // Put somewhere in your script
{
SetVehicleVelocity(GetPlayerVehicleID(playerid), 0, 0, 5.0);
return 1;
}
Script not tested
Re: Car Hop -
braduz - 23.01.2010
Quote:
Originally Posted by <Krys>
pawn Код:
forward CarHop(playerid); // On Top of your script
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(strcmp(cmdtext, "/carhop", true) == 0) { if(IsPlayerInAnyVehicle(playerid)) { SetVehicleVelocity(GetPlayerVehicleID(playerid), 0, 0, 5.0); SetTimer("CarHop", 5000, 1); return 1; } } else { SendClientMessage(playerid, 0xFFFFF, "You are not in a vehicle"); return 1; } return 0; }
pawn Код:
public CarHop(playerid) // Put somewhere in your script { SetVehicleVelocity(GetPlayerVehicleID(playerid), 0, 0, 5.0); return 1; }
Script not tested
|
wtf return 0 allways disables all cmds
Re: Car Hop -
stieben - 24.01.2010
Doesn't work like how I want it
Re: Car Hop -
mansonh - 24.01.2010
What do you want it to do exactly, that code should continue you in the direction your going in and hop.
Re: Car Hop -
stieben - 24.01.2010
Well, it doesn't continue the direction. It just stops and hops.
Re: Car Hop -
MadeMan - 24.01.2010
It continues, but because the hop is so powerful, you can't see it. Try making the z velocity smaller.