#define PRESSED(%0) \\(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) if(PRESSED(KEY_SUB_MISSION)) { if(IsPlayerInAnyVehicle(playerid)) { new kocsi; kocsi = GetPlayerVehicleID(playerid); SetVehicleHealth(kocsi, 1000); //vagy 100...nem tudom mi is a max kocsi élet de azthiszem 1000 } } if(PRESSED(KEY_HORN)) { if(IsPlayerInAnyVehicle(playerid)) { new kocsi; new float:x,y,z; kocsi = GetPlayerVehicleID(playerid); GetVehiclePos(kocsi, x, y, z); SetVehicleVelocity(kocsi, x, y, z+5); } } return 1;}
#define PRESSED(%0) \\ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
new car;
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){if(PRESSED(KEY_SUB_MISSION)) {if(IsPlayerInAnyVehicle(playerid)) { car = GetPlayerVehicleID(playerid); SetVehicleHealth(car, 1000);}}if(PRESSED(KEY_HORN)) {if(IsPlayerInAnyVehicle(playerid)) { new Float:x, y, z; car = GetPlayerVehicleID(playerid); GetVehiclePos(car, x, y, z); SetVehicleVelocity(car, x, y, z+5);}}if(PRESSED(KEY_FIRE)) {if(IsPlayerInAnyVehicle(playerid)) { new Float:x, y, z; car = GetPlayerVehicleID(playerid); GetVehicleVelocity(car, x, y, z); SetVehicleVelocity(car, x * 1.3, y *1.3, z * 1.3);}}return 1;}
Szntem a kadaradamos éri meg a legjobban!
if(PRESSED(KEY_HORN)) { if(IsPlayerInAnyVehicle(playerid)) { new Float:x, y, z; car = GetPlayerVehicleID(playerid); GetVehiclePos(car, x, y, z); SetVehicleVelocity(car, x, y, z+5); } } [/quote]Az y és z koordinátánál lehagytad a floatot.Ugyanis warrningos lesz, ha kihagyja.Helyesen:if(PRESSED(KEY_HORN)) { if(IsPlayerInAnyVehicle(playerid)) { new Float:x, Float:y, Float:z; car = GetPlayerVehicleID(playerid); GetVehiclePos(car, x, y, z); SetVehicleVelocity(car, x, y, z+5); } } De szólj ha rosszul tudom.Köszönöm figyelmedet!(javítottam)
if(PRESSED(KEY_HORN)) { if(IsPlayerInAnyVehicle(playerid)) { new Float:x, Float:y, Float:z; car = GetPlayerVehicleID(playerid); GetVehiclePos(car, x, y, z); SetVehicleVelocity(car, x, y, z+5); } }