13.06.2010, 13:27
ok I added a velocity to cars and well it makes the car faster and also makes it jump 10ft in the air all that works is the jump
i did get 2 warnings :
and this is all that is in the filterscript:
i did get 2 warnings :
Код:
#include <a_samp> #define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) new Tick[MAX_PLAYERS]; OnPlayerUpdate(playerid) { Tick[playerid]++; if(Tick[playerid] != 3) return 1; Tick[playerid] = 0; new Keys,up,down; GetPlayerKeys(playerid,Keys,up,down); new Float:x,Float:y,Float:z; if(Keys &= 1024) { if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { GetPlayerVelocity(playerid,x,y,z); SetPlayerVelocity(playerid,x*1.2,y*1.2,z*1.2); } } else if(Keys &= 4) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z); SetVehicleVelocity(GetPlayerVehicleID(playerid),x*1.2,y*1.2,z*1.2); } } return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (PRESSED(KEY_HANDBRAKE)) // Change KEY_HANDBRAKE to your choice of PlayerKeys { new Float:x, Float:y, Float:z; GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z); SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3); } return 1; }
Код:
#include <a_samp> #define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) new Tick[MAX_PLAYERS]; OnPlayerUpdate(playerid) { Tick[playerid]++; if(Tick[playerid] != 3) return 1; Tick[playerid] = 0; new Keys,up,down; GetPlayerKeys(playerid,Keys,up,down); new Float:x,Float:y,Float:z; if(Keys &= 1024) { if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { GetPlayerVelocity(playerid,x,y,z); SetPlayerVelocity(playerid,x*1.2,y*1.2,z*1.2); } } else if(Keys &= 4) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z); SetVehicleVelocity(GetPlayerVehicleID(playerid),x*1.2,y*1.2,z*1.2); } } return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if (PRESSED(KEY_HANDBRAKE)) // Change KEY_HANDBRAKE to your choice of PlayerKeys { new Float:x, Float:y, Float:z; GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z); SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3); } return 1; }