#include a_sampJumpVeh(vid, Float:dis = 0.5){new Float:T[3];GetVehicleVelocity(vid, T[0], T[1], T[2]);SetVehicleVelocity(vid, T[0], T[1], floatadd(T[2],dis));return 1;}public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) if (newkeys & 2 && GetPlayerState(playerid)-1) return JumpVeh(GetPlayerVehicleID(playerid),0.2); else return 1;
megnyomod a H t felugrik a kocsi.
eps megcsinálnád ugy ezt hogy csak akkor ha pl a jump[playerid] = 1; -el csak akkor lehesssen h-val ugrani ha 0-valegyenlöre akkor ne csináljon semit?:S
#include a_sampnew bool:jump[MAX_PLAYERS];#define COLOR_RED 0xFF0000AA#define COLOR_GREEN 0x33AA33AAJumpVeh(vid, Float:dis = 0.5){new Float:T[3];GetVehicleVelocity(vid, T[0], T[1], T[2]);SetVehicleVelocity(vid, T[0], T[1], floatadd(T[2],dis));return 1;}public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){ if (newkeys & 2 && GetPlayerState(playerid)-1) { if(jump[playerid] == true) return JumpVeh(GetPlayerVehicleID(playerid),0.2); } return 1;}// innentol ez nem fontospublic OnPlayerConnect(playerid) return jump[playerid] = true;public OnPlayerCommandText(playerid, cmdtext[]){if (strcmp(\"/jumpon\", cmdtext, true, 10) == 0){if(jump[playerid] == true) return SendClientMessage(playerid, COLOR_RED,\"A jump már be van kapcsolva\"); jump[playerid] = true; SendClientMessageToAll(COLOR_RED,\"jump bekapcsolva\"); return 1;}if (strcmp(\"/jumpoff\", cmdtext, true, 10) == 0){if(jump[playerid] == false) return SendClientMessage(playerid, COLOR_RED,\"A jump már ki van kapcsolva\"); jump[playerid] = false; SendClientMessageToAll(COLOR_GREEN,\" jump kikapcsolva\");return 1;}return 1;}
#include a_sampnew bool:jump[MAX_PLAYERS];JumpVeh(vid, Float:dis = 0.5){new Float:T[3];GetVehicleVelocity(vid, T[0], T[1], T[2]);SetVehicleVelocity(vid, T[0], T[1], floatadd(T[2],dis));return 1;}public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) if (newkeys & 2 && GetPlayerState(playerid)-1 && jump[playerid]) return JumpVeh(GetPlayerVehicleID(playerid),0.2); else return 1;public OnPlayerConnect(playerid) return jump[playerid] = false;public OnPlayerCommandText(playerid, cmdtext[]){if (!strcmp(\"/jump\", cmdtext, true)){if(jump[playerid]) jump[playerid] = false; else jump[playerid] = true;if(jump[playerid]) return SendClientMessage(playerid,0x33AA33AA,\"Jármu ugrás bekapcsolva\"); else return SendClientMessage(playerid,0x33AA33AA,\"Jármu ugrás kikapcsolva\");}return 0;}
Mert an-yád az - am azér töröltem, hogy ne az enyémet töltse le, hanem pepsiét. (am csak 1sor az, ami nem az enyém. de itt nagy lowok vannak ezér vitatkoznak..)