Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MAX_GATES 5
- new bool:gate[MAX_GATES];
- new gateid[MAX_GATES];
- enum gateinfo
- {
- VartuID,
- Float:gX,
- Float:gY,
- Float:gZ,
- Float:gRX,
- Float:gRY,
- Float:gRZ
- };
- new gates[MAX_GATES][gateinfo]={
- {968,-1572.19666,658.63202,6.9021,0.0,90.00,90.0}, //pd
- {968,-1701.41809,687.78229,24.6812,0.0,90.0,-90.0}, // pd
- {968,-2038.0072,-103.5425,35.3543,0.0,90.0,900.0}, // pd
- {980,-717.58337, 964.64331, 13.90640, 0.00000, 0.00000, 90.00000},//gaujos
- {968,-2695.253662, -189.174194, 3.864799, 0.000000, -90.000000, 90.000000}}; // TAXI
- stock MoveNearestGate(playerid)
- {
- for(new g;g<MAX_GATES;g++)
- {
- if(IsPlayerInRangeOfPoint(playerid,10,gates[g][gX],gates[g][gY],gates[g][gZ]))
- {
- if(gate[g]==true)
- {
- if(gates[g][VartuID]==968)
- {
- MoveDynamicObject(gateid[g],gates[g][gX],gates[g][gY],gates[g][gZ],0.02,gates[g][gRX],gates[g][gRY],gates[g][gRZ]);
- gate[g]=false;
- }
- else
- {
- MoveDynamicObject(gateid[g],gates[g][gX],gates[g][gY],gates[g][gZ],2,gates[g][gRX],gates[g][gRY],gates[g][gRZ]);
- gate[g]=false;
- }
- }
- else
- {
- if(gates[g][VartuID]==968)
- {
- MoveDynamicObject(gateid[g],gates[g][gX],gates[g][gY]+0.05,gates[g][gZ],0.02,gates[g][gRX],gates[g][gRY]-90,gates[g][gRZ]);
- gate[g]=true;
- }
- else
- {
- MoveDynamicObject(gateid[g],gates[g][gX],gates[g][gY]-12,gates[g][gZ],2,gates[g][gRX],gates[g][gRY],gates[g][gRZ]);
- gate[g]=false;
- }
- }
- }
- }
- return 1;
- }
- public OnGameModeInit()
- {
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- for(new g;g<MAX_GATES;g++)
- {
- gate[g]=false;
- gateid[g] = CreateDynamicObject(gates[g][VartuID],gates[g][gX],gates[g][gY],gates[g][gZ],gates[g][gRX],gates[g][gRY],gates[g][gRZ],-1,-1);
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == KEY_YES) MoveNearestGate(playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement