Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///// ANGULO X * cps ANGULO Y = DIF 90 - RESULTADO
- //Experimental FS by adri1
- //==============================================================================
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- new MOVEBASE, st,// count,
- Float:angle = 0.0, Float:aVel, Float:aAcc,
- Float:Origin_X = 0.0, Float:Origin_Y = 25.0, Float:len = -25.0, Float:damping = 1.0,
- Text:TDEditor_TD;
- public OnFilterScriptInit()
- {
- CreateObject(1946, 0.0, 0.0, Origin_Y, 0.00000, 0.00000, 0.00000, 1000.0);
- MOVEBASE = CreateObject(19130 , 0.0, 0.0, 0.0, 0.00000, 0.00000, 0.00000, 1000.0);
- //AttachObjectToObject(CreateObject(19740, 0.00000, 0.00000, 6.25000, 0.00000, 90.00000, 180.00000), MOVEBASE, 0.0, 0.0, 6.25, 0.0, 90.0, 180.0);
- //AttachObjectToObject(CreateObject(19740, 0.00000, 0.00000, 6.25000, 0.00000, 90.00000, 180.00000), MOVEBASE, 0.0, 0.0, 18.75, 0.0, 90.0, 180.0);
- new SEATBASE = CreateObject(18886, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
- //SetObjectMaterial(SEATBASE, 0, 18646, "matcolours", "samporange");
- AttachObjectToObject(SEATBASE, MOVEBASE, 0.0, 0.0, -0.5, 0.0, 0.0, 0.0);
- new seat = CreateObject(1562, 0, 0, 0, 0.00, 0.00, 0.00);
- AttachObjectToObject(seat, SEATBASE, -0.6162, 2.0824, -0.4397, 0.0000, 0.0000, 195.0000);
- SetObjectMaterial(seat, 0, 1562, "ab_jetseat", "mp_jet_seat", 0xFF00CCFF);
- seat = CreateObject(1562, 0, 0, 0, 0.00, 0.00, 0.00);
- AttachObjectToObject(seat, SEATBASE, -1.4831, 1.4819, -0.4397, 0.0000, 0.0000, 225.0000);
- seat = CreateObject(1562, 0, 0, 0, 0.00, 0.00, 0.00);
- AttachObjectToObject(seat, SEATBASE, -2.1035, 0.5745, -0.4397, 0.0000, 0.0000, 255.0000);
- seat = CreateObject(1562, 0, 0, 0, 0.00, 0.00, 0.00);
- AttachObjectToObject(seat, SEATBASE, -2.1016, -0.5955, -0.4397, 0.0000, 0.0000, 285.0000);
- seat = CreateObject(1562, 0, 0, 0, 0.00, 0.00, 0.00);
- AttachObjectToObject(seat, SEATBASE, -1.5044, -1.5795, -0.4397, 0.0000, 0.0000, 315.0000);
- seat = CreateObject(1562, 0, 0, 0, 0.00, 0.00, 0.00);
- AttachObjectToObject(seat, SEATBASE, -0.5645, -2.1727, -0.4397, 0.0000, 0.0000, 345.0000);
- SetObjectMaterial(seat, 0, 1562, "ab_jetseat", "mp_jet_seat", 0xFF0000FF);
- seat = CreateObject(1562, 0, 0, 0, 0.00, 0.00, 0.00);
- AttachObjectToObject(seat, SEATBASE, 0.573, -2.1273, -0.4397, 0.0000, 0.0000, -345.0000);
- seat = CreateObject(1562, 0, 0, 0, 0.00, 0.00, 0.00);
- AttachObjectToObject(seat, SEATBASE, 1.5295, -1.5389, -0.4397, 0.0000, 0.0000, -315.0000);
- seat = CreateObject(1562, 0, 0, 0, 0.00, 0.00, 0.00);
- AttachObjectToObject(seat, SEATBASE, 2.1129, -0.5817, -0.4397, 0.0000, 0.0000, -285.0000);
- seat = CreateObject(1562, 0, 0, 0, 0.00, 0.00, 0.00);
- AttachObjectToObject(seat, SEATBASE, 2.0814, 0.5617, -0.4397, 0.0000, 0.0000, -255.0000);
- seat = CreateObject(1562, 0, 0, 0, 0.00, 0.00, 0.00);
- AttachObjectToObject(seat, SEATBASE, 1.5124, 1.5704, -0.4397, 0.0000, 0.0000, -225.0000);
- seat = CreateObject(1562, 0, 0, 0, 0.00, 0.00, 0.00);
- AttachObjectToObject(seat, SEATBASE, 0.5522, 2.0793, -0.4397, 0.0000, 0.0000, -195.0000);
- CreateObject(18981, -3.50000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000);
- CreateObject(18981, -3.50000, -25.00000, 25.00000, 0.00000, 0.00000, 0.00000);
- CreateObject(18981, -3.50000, 25.00000, 25.00000, 0.00000, 0.00000, 0.00000);
- SetObjectMaterial(CreateObject(18981, -3.50000, -25.00000, 0.00000, 0.00000, 0.00000, 0.00000), 0, 18646, "matcolours", "yellow");
- SetObjectMaterial(CreateObject(18981, -3.50000, 25.00000, 0.00000, 0.00000, 0.00000, 0.00000), 0, 18646, "matcolours", "yellow");
- SetObjectMaterial(CreateObject(18981, -3.50000, 0.00000, 25.00000, 0.00000, 0.00000, 0.00000), 0, 18646, "matcolours", "yellow");
- TDEditor_TD = TextDrawCreate(500.000000, 355.000000, "Initial_speed:_50~n~Rotation:_90~n~Angle:_30.0~n~Gravity:_9.8");
- TextDrawLetterSize(TDEditor_TD, 0.400000, 1.600000);
- TextDrawTextSize(TDEditor_TD, 650.000000, 0.000000);
- TextDrawAlignment(TDEditor_TD, 1);
- TextDrawColor(TDEditor_TD, -1);
- TextDrawUseBox(TDEditor_TD, 1);
- TextDrawBoxColor(TDEditor_TD, 255);
- TextDrawSetShadow(TDEditor_TD, 0);
- TextDrawSetOutline(TDEditor_TD, 0);
- TextDrawBackgroundColor(TDEditor_TD, 255);
- TextDrawFont(TDEditor_TD, 1);
- TextDrawSetProportional(TDEditor_TD, 1);
- TextDrawSetShadow(TDEditor_TD, 0);
- return 1;
- }
- public OnFilterScriptExit()
- {
- KillTimer(st);
- DestroyObject(MOVEBASE);
- DestroyObject(MOVEBASE+1);
- DestroyObject(MOVEBASE+2);
- DestroyObject(MOVEBASE+3);
- TextDrawDestroy(TDEditor_TD);
- return 1;
- }
- new Float:X, Float:Y, Float:Z, Float:RZ;
- forward Update();
- public Update()
- {
- GetObjectPos(MOVEBASE, X, Y, Z);
- Y = Origin_X + (len * floatsin(angle, degrees));
- Z = Origin_Y + (len * floatcos(angle, degrees));
- SetObjectPos(MOVEBASE, X, Y, Z);
- aAcc = (-0.005) * floatsin(angle, degrees);
- aVel += aAcc;
- angle += aVel;
- aVel *= damping;
- //printf("%f, %f", aAcc, aVel);
- RZ += 1.0;
- SetObjectRot(MOVEBASE, -angle, 0.0, 0.0);
- EDIT_OBJECT_RotateZ(MOVEBASE, RZ); //This is for rotate bob, function from UOE by Stylock
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- TextDrawShowForPlayer(playerid, TDEditor_TD);
- UpdateTextDraw();
- RemoveBuildingForPlayer(playerid, 1308, 9.0234, 15.1563, -5.7109, 0.25);
- RemoveBuildingForPlayer(playerid, 13056, -43.8984, 41.1094, 2.1094, 0.25);
- RemoveBuildingForPlayer(playerid, 3376, -15.5234, 68.4531, 6.6641, 0.25);
- RemoveBuildingForPlayer(playerid, 13413, -114.5781, -47.4063, 2.0234, 0.25);
- RemoveBuildingForPlayer(playerid, 13414, 50.1797, -43.2813, 0.9844, 0.25);
- RemoveBuildingForPlayer(playerid, 13049, -114.5781, -47.4063, 2.0234, 0.25);
- RemoveBuildingForPlayer(playerid, 13050, 50.1797, -43.2813, 0.9844, 0.25);
- RemoveBuildingForPlayer(playerid, 3276, -23.7344, 0.2656, 2.8906, 0.25);
- RemoveBuildingForPlayer(playerid, 3374, -50.0156, 3.1797, 3.4766, 0.25);
- RemoveBuildingForPlayer(playerid, 3276, -19.1953, 11.4688, 2.8906, 0.25);
- RemoveBuildingForPlayer(playerid, 3276, -10.9141, 15.3828, 2.8906, 0.25);
- RemoveBuildingForPlayer(playerid, 672, -35.7109, 18.1016, 3.4766, 0.25);
- RemoveBuildingForPlayer(playerid, 12919, -43.8984, 41.1094, 2.1094, 0.25);
- RemoveBuildingForPlayer(playerid, 3375, -15.5234, 68.4531, 6.6641, 0.25);
- return 1;
- }
- CMD:go(playerid, params[])
- {
- st = SetTimer("Update", 10, 1);
- return 1;
- }
- CMD:restart(playerid, params[])
- {
- KillTimer(st);
- aAcc = 0.0;
- aVel = aAcc;
- return 1;
- }
- CMD:angle(playerid, params[])
- {
- if(sscanf(params, "f", angle)) return SendClientMessage(playerid, -1, "{996600}ERROR: /speed [Float: speed]");
- UpdateTextDraw();
- Y = Origin_X + (len * floatsin(angle, degrees));
- Z = Origin_Y + (len * floatcos(angle, degrees));
- SetObjectPos(MOVEBASE, X, Y, Z);
- SetObjectRot(MOVEBASE, -angle, 0.0, 0.0);
- return 1;
- }
- CMD:damping(playerid, params[])
- {
- if(sscanf(params, "f", damping)) return SendClientMessage(playerid, -1, "{996600}ERROR: /damping [Float: damping]");
- UpdateTextDraw();
- return 1;
- }
- UpdateTextDraw()
- {
- new str[128];
- format(str, sizeof(str), "Lenght:_%.1f~n~Damping:_%.3f~n~Initial Angle:_%.1f", -len, damping, angle);
- TextDrawSetString(TDEditor_TD, str);
- }
- //From Universal Object Editor by Stylock
- new
- Float:g_Float1[3],
- Float:sx,
- Float:sy,
- Float:sz,
- Float:cx,
- Float:cy,
- Float:cz;
- EDIT_OBJECT_RotateZ(oid, Float:rot_z)
- {
- EDIT_OBJECT_GetRot(oid, g_Float1);
- EDIT_ConvertValue(g_Float1[0], g_Float1[1], g_Float1[2]);
- EDIT_ConvertValue(asin(cx * cy), atan2(sx, cx * sy) + rot_z, atan2(cy * cz * sx - sy * sz, cz * sy - cy * sx * -sz));
- EDIT_OBJECT_SetRot(oid, asin(cx * sy), atan2(cx * cy, sx), atan2(cz * sx * sy - cy * sz, cy * cz + sx * sy * sz));
- return 1;
- }
- EDIT_OBJECT_GetRot(oid, Float:rot[3])
- {
- if(IsValidObject(oid))
- {
- GetObjectRot(oid, rot[0], rot[1], rot[2]);
- EDIT_ModuloOperation(rot[0], rot[1], rot[2]);
- }
- return 1;
- }
- EDIT_ConvertValue(Float:rot_x, Float:rot_y, Float:rot_z)
- {
- sx = floatsin(rot_x, degrees);
- sy = floatsin(rot_y, degrees);
- sz = floatsin(rot_z, degrees);
- cx = floatcos(rot_x, degrees);
- cy = floatcos(rot_y, degrees);
- cz = floatcos(rot_z, degrees);
- return 1;
- }
- EDIT_ModuloOperation(&Float:rot_x, &Float:rot_y, &Float:rot_z)
- {
- EDIT_Remainder(rot_x, 360.0);
- EDIT_Remainder(rot_y, 360.0);
- EDIT_Remainder(rot_z, 360.0);
- return 1;
- }
- EDIT_Remainder(&Float:remainder, Float:value)
- {
- if(remainder >= value)
- {
- while(remainder >= value)
- {
- remainder = remainder - value;
- }
- }
- else if(remainder < 0.0)
- {
- while(remainder < 0.0)
- {
- remainder = remainder + value;
- }
- }
- return 1;
- }
- EDIT_OBJECT_SetRot(oid, Float:rX, Float:rY, Float:rZ)
- {
- SetObjectRot(oid, rX, rY, rZ);
- return 1;
- }
- //Experimental FS by adri1
- //==============================================================================
Add Comment
Please, Sign In to add comment