#include <a_samp>#define red 0xFF0000AAnew Pressedkey[MAX_PLAYERS] = {false, ...};new jumped[MAX_PLAYERS] = {-1, ...};new ramped[MAX_PLAYERS];forward Keys(playerid);forward DeleteRamp(playerid);forward Float:GetRampDistance(playerid);forward Float:GetPosInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance);public OnFilterScriptInit(){SetTimer(\"Keys\", 100, 1);return 1;}public Keys(playerid){new keys, jump, updown;new Float:x, Float:y, Float:z;for (playerid = 0; playerid < MAX_PLAYERS; playerid++) { if (IsPlayerConnected(playerid)) { GetPlayerKeys(playerid, keys, jump, updown); if(ramped[playerid] == 1) { } else if (keys & KEY_ACTION && IsPlayerInAnyVehicle(playerid)) {{ GetPlayerPos(playerid, x, y, z); jumped[playerid] = SetVehiclePos(GetPlayerVehicleID(playerid),x, y, z+10.5); } } } else Pressedkey[playerid] = false;}} public OnFilterScriptExit(){for (new i=0; i<MAX_PLAYERS; i++){if (jumped != -1) DestroyObject(jumped);}} public OnPlayerExitVehicle(playerid, vehicleid){for (new i=0; i<MAX_PLAYERS; i++){if (jumped != -1) DestroyObject(jumped);}}
GetVehicleVelocity(GetPlayerVehicleID(i),x,y,z);SetVehicleVelocity(GetPlayerVehicleID(i),x,y,z+0.2);
public Jumpboost(){for(new i; i < MAX_PLAYERS; i++){ new Keys,up,down;GetPlayerKeys(i,Keys,up,down); if(Keys &= 12) { if(GetPlayerState(i) == PLAYER_STATE_DRIVER) { new Float:x,Float:y,Float:z; GetVehicleVelocity(GetPlayerVehicleID(i),x,y,z); SetVehicleVelocity(GetPlayerVehicleID(i),x,y,z+0.2); } }}}return 1;}
mi az a \"public Keys\"?Én ezt ismerem :public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)[/quote]Ez egy létrehozott prototípus.Lásd:forward Keys(playerid);
forward Keys(playerid);
GroX: Minek saját key függvényt írni, ha van?