09.12.2013, 01:21
Alright so i've been working on making a forklift attachment thing when you type /getcrate you will get a crate attached to the forklift. The thing is once i type the command when i'm inside of the vehicle, nothing gets attached even when I told it to attach it when i'm inside of the forklift. Please help
I compiled the whole thing, nothing seems to be wrong.. I just can't figure out why this is happening
Код:
#include <a_samp>
#include <zcmd>
#include <streamer>
#include <YSI\y_timers>
#define SendFormattedMessage(%0,%1,%2) do{new _str[128]; format(_str,128,%2); SendClientMessageEx(%0,%1,_str);}while(FALSE)
#define GetVehicleName(%0) VehicleName[GetVehicleModel(%0)-400]
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_CYAN 0x00FFFFFF
IsAForklift(carid)
{
new Forklift[] = { 530 };
for(new i = 0; i < sizeof(Forklift); i++)
{
if(GetVehicleModel(carid) == Forklift[i]) return 1;
}
return 0;
}
public OnFilterScriptInit()
{
CreateDynamicObject(3574,2353.8000500,-2026.0999800,15.3000000,0.0000000,0.0000000,0.0000000); //object(lasdkrtgrp2) (1)
CreateDynamicObject(944,2360.1001000,-2020.1999500,13.4000000,0.0000000,0.0000000,0.0000000); //object(packing_carates04) (5)
CreateDynamicObject(944,2357.3000500,-2020.1999500,13.4000000,0.0000000,0.0000000,0.0000000); //object(packing_carates04) (6)
CreateDynamicObject(944,2354.3999000,-2020.1999500,13.4000000,0.0000000,0.0000000,0.0000000); //object(packing_carates04) (7)
CreateDynamicObject(944,2351.6001000,-2020.1999500,13.4000000,0.0000000,0.0000000,0.0000000); //object(packing_carates04) (8)
return 1;
}
new CrateBox;
CMD:getcrate(playerid, params[])
{
if (IsPlayerInRangeOfPoint(playerid, 10.0, 2353.8000500, -2026.0999800, 15.3000000)) // Matrun 3
{
new vehicle = GetPlayerVehicleID(playerid);
if(IsAForklift(vehicle))
{
CrateBox = CreateObject(1685, 10.0, 10.0, 10.0, 0, 0, 0);
AttachObjectToVehicle(CrateBox, 530, 0.000000, 0.999999, 0.529999, 0.000000, 0.000000, 0.000000); //Object Model: 1685 | obj
}
else SendClientMessage(playerid, COLOR_YELLOW, "You are not inside of a Forklift or near the Get Crate point");
}
return 1;
}

