nekem van egy olyan, ami NUM6-tal veszi fel, teszi le. VKmaster muve :amazed:
#include <a_samp>
#define KEY_ANALOG_LEFT 16384
#define COLOR_WHITE 0xFFFFFFAA
public OnFilterScriptInit()
{
print(\"\\n--------------------------------------\");
print(\" All Vehicles Trailers By VKmaster \");
print(\"--------------------------------------\\n\");
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_ANALOG_LEFT ){
if(IsPlayerInAnyVehicle(playerid)){
new vehid = GetPlayerVehicleID(playerid);
if(!IsTrailerAttachedToVehicle(vehid)){
new Float:x, Float:y, Float:z;
GetVehiclePos(vehid, x, y, z );
new vehiclet;
GetVehicleWithinDistance(playerid, x, y, z, 100.0, vehiclet);
AttachTrailerToVehicle(vehiclet, vehid);
}
else{
DetachTrailerFromVehicle(vehid);
}
}
}
return 1;
}
GetVehicleWithinDistance( playerid, Float:x1, Float:y1, Float:z1, Float:dist, &vehic){
for(new i = 1; i < MAX_VEHICLES; i++){
if(GetVehicleModel(i) > 0){
if(GetPlayerVehicleID(playerid) != i ){
new Float:x, Float:y, Float:z;
new Float:x2, Float:y2, Float:z2;
GetVehiclePos(i, x, y, z);
x2 = x1 - x; y2 = y1 - y; z2 = z1 - z;
new Float:iDist = (x2*x2+y2*y2+z2*z2);
printf(\"Vehicle %d is %f\", i, iDist);
if( iDist < dist){
vehic = i;
}
}
}
}
}
public ad() {
new msg[256];
format(msg, sizeof(msg), \"Tip: Ctrl lerak egy rámpát /setramp 1-5 különbözo rámpákért!\");
format(msg, sizeof(msg), \"Jármu szálitáshoz nyomd meg a NUM 6-ot!\");
SendClientMessageToAll(COLOR_WHITE, msg);
return 1;
}
a végén van ramp, hogy kattra leteszi az ugratót, de az nem müxik, csak az üzenet van benne.