SA-MP Forums Archive
[REQ]Some Requests - 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: [REQ]Some Requests (/showthread.php?tid=137336)



[REQ]Some Requests - yoan103 - 28.03.2010

I am not a pro at scripting, so do you know the server Awesome Stuntages? Well if you have played in it, could you tell me how to make their speedboost and jump with the 2 button?


Re: [REQ]Some Requests - aircombat - 28.03.2010

if u mean when u press a button it do something , here is how its done :
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & KEY_CROUCH))
{
//do something here
}
return 1;
}
and search on SpeedBoost there is 1 which use buttom H to speed boost


Re: [REQ]Some Requests - yoan103 - 28.03.2010

Yes, but i don't understand theese strings and such and what must you add x y z + ..... there is so much, how can i set my car on air?


Re: [REQ]Some Requests - aircombat - 28.03.2010

z is the altitude so if u like add : SetVehiclePos(vehicleid,vehiclex,vehicley,vehiclez +30); will make it jump here is an example (not test):
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & KEY_CROUCH))
{
new vehicleid = GetPlayerVehicleID(playerid);
new Float:vehiclex;
new Float:vehicley;
new Float:vehiclez;
GetVehiclePos(vehicleid,vehiclex,vehicley,vehiclez);
SetVehiclePos(vehicleid,vehiclex,vehicley,vehiclez+30);
}
return 1;
}
when u do this ,, when u press Crouch, ur car will jump