[Ajuda] Ferry bugado.
#1

Tipo o portгo mais o navio nгo aparece ...
PHP код:
#include <a_samp>
#include "../include/gl_common.inc"
#define NUM_SHIP_ROUTE_POINTS   7
#define SHIP_HULL_ID              9585 // massive cargo ship's hull. This is used as the main object
#define SHIP_MOVE_SPEED         15.0
#define SHIP_DRAW_DISTANCE      300.0
#define NUM_SHIP_ATTACHMENTS    10
#define GREEN                   0xffffffFF
#define RED                     0xffffffFF
new holePlug;
new 
gShipRampCI;
new 
gShipRampLI;
new 
gShipFenceCI;
new 
gShipFenceLI;
new 
HourMinuteSecond;
new 
strFerry[1000];
new 
Float:gShipHullOrigin[3] =
{-
2409.84381544.94537.0000}; // so we can convert world space to model space for attachment positions
new gShipAttachmentModelIds[NUM_SHIP_ATTACHMENTS] = {
9586// Ship main platform
9761// Ship rails
9584// Bridge exterior
9698// Bridge interior
9821// Bridge interior doors
9818// Bridge radio desk
9819// Captain's desk
9822// Captain's seat
9820// Bridge ducts and lights
9590// Cargo bay area
};
new 
Float:gShipAttachmentPos[NUM_SHIP_ATTACHMENTS][6] = {
// these are world space positions used on the original cargo ship in the game
// they will be converted to model space before attaching
{-2412.12501544.945317.0469,  0.00.00.0},
{-
2411.39061544.945327.0781,  0.00.00.0},
{-
2485.07811544.945326.1953,  0.00.00.0},
{-
2473.58591543.773429.0781,  0.00.00.0},
{-
2474.35941547.242224.7500,  0.00.00.0},
{-
2470.26561544.960933.8672,  0.00.00.0},
{-
2470.45311551.117233.1406,  0.00.00.0},
{-
2470.93751550.750032.9063,  0.00.00.0},
{-
2474.62501545.085933.0625,  0.00.00.0},
{-
2403.50781544.94538.7188,  0.00.00.0}
};
// Route points (position/rotation)
new Float:gShipRoutePoints[NUM_SHIP_ROUTE_POINTS][6] = {
{
2070.15, -3250.100.00.000.00180.00},
{
2185.15, -3250.100.00.000.00195.00},
{
7002.0, -1496.2180.00.000.00195.00},
{
7002.0, -1466.218, -3.700.000.00180.00},
{
7002.0, -1496.2180.00.000.00195.00},
{
2085.78, -3250.100.00.000.00195.00},
{
2070.15, -3250.100.00.000.00180.00}
};
new 
gShipCurrentPoint 1// current route point the ship is at. We start at route 1
new gMainShipObjectId;
new 
gShipsAttachments[NUM_SHIP_ROUTE_POINTS];
forward BeforeMovingTimer();
public 
BeforeMovingTimer()
{
    if(
gShipCurrentPoint == || gShipCurrentPoint == 4)
    {
        
gettime(HourMinuteSecond);
        
SendClientMessageToAll(-1"{0065C2}-------------------------------------------------------------");
        
format(strFerrysizeof(strFerry), "{ffffff}O ferry irб partir dentro de {0065C2}60 {ffffff}segundos!");
        
SendClientMessageToAll(GREENstrFerry);
        
SendClientMessageToAll(-1"{0065C2}-------------------------------------------------------------");
    }
    
SetTimer("StartMovingTimer",60*1000,0); // pause for 1 minutes
}
forward StartMovingTimer();
public 
StartMovingTimer()
{
    if(
gShipCurrentPoint == || gShipCurrentPoint == || gShipCurrentPoint == || gShipCurrentPoint == 6)
    {
        if(
gShipCurrentPoint == 1)
        {
            
// close dock CI
            
MoveObject(gShipRampCI2007.0, -3202.2863774.0517.18870.00.0); // hide CI ramp
            
MoveObject(gShipFenceCI2007.541504, -3230.81347713.1318040.2, -6.2831840.0000000.000000); // show CI fence
        
}
        if(
gShipCurrentPoint == 4)
        {
            
// close dock LI
            
MoveObject(gShipRampLI6973.289063, -1414.7735602.0517.18870.00000.0000); // hide LI ramp
            
MoveObject(gShipFenceLI6973.238281, -1443.74231010.8144900.20.00000.00000.0000); // show LI fence
        
}
        
MoveObject(gMainShipObjectId,gShipRoutePoints[gShipCurrentPoint][0],
                    
gShipRoutePoints[gShipCurrentPoint][1],
                    
gShipRoutePoints[gShipCurrentPoint][2],
                    
SHIP_MOVE_SPEED 10.0// slower for the first route
                    
gShipRoutePoints[gShipCurrentPoint][3],
                    
gShipRoutePoints[gShipCurrentPoint][4],
                    
gShipRoutePoints[gShipCurrentPoint][5]);
    }
    else
    {
        
MoveObject(gMainShipObjectId,gShipRoutePoints[gShipCurrentPoint][0],
                    
gShipRoutePoints[gShipCurrentPoint][1],
                    
gShipRoutePoints[gShipCurrentPoint][2],
                    
SHIP_MOVE_SPEED,
                    
gShipRoutePoints[gShipCurrentPoint][3],
                    
gShipRoutePoints[gShipCurrentPoint][4],
                    
gShipRoutePoints[gShipCurrentPoint][5]);
    }
}
public 
OnFilterScriptInit()
{
    
Create3DTextLabel("{FFFF00}Pressione 'F'\nPara abrir o menu de licencas"0x008080FF, -2033.0, -100.036.030.00);
    
// Ramps & fences
    
gShipRampCI CreateObject(89472007.0, -3242.2863775.76030117.18870.00000.0000); // CI ramp
    
gShipFenceCI CreateObject(9792007.541504, -3230.81347711.631804, -6.2831840.0000000.000000); // CI fence
    
gShipRampLI CreateObject(89476973.289063, -1414.7735602.017.18870.00000.0000); // LI ramp
    
gShipFenceLI CreateObject(9796973.238281, -1443.74231010.8144900.00000.00000.0000); // LI fence
    
gMainShipObjectId CreateObject(SHIP_HULL_IDgShipRoutePoints[0][0], gShipRoutePoints[0][1], gShipRoutePoints[0][2],
                                    
gShipRoutePoints[0][3], gShipRoutePoints[0][4], gShipRoutePoints[0][5], SHIP_DRAW_DISTANCE);
    
SetTimer("BeforeMovingTimer",4*60*1000,0);
    
holePlug CreateObject(36010.00.00.00.00.00.0SHIP_DRAW_DISTANCE);
    
AttachObjectToObject(holePluggMainShipObjectId, -28.128856, -2.8057741.4886990.00.0315.0);
    new 
x=0;
    while(
!= NUM_SHIP_ATTACHMENTS) {
        
gShipsAttachments[x] = CreateObject(gShipAttachmentModelIds[x], 0.00.00.00.00.00.0SHIP_DRAW_DISTANCE);
        
AttachObjectToObject(gShipsAttachments[x], gMainShipObjectId,
                    
gShipAttachmentPos[x][0] - gShipHullOrigin[0],
                    
gShipAttachmentPos[x][1] - gShipHullOrigin[1],
                    
gShipAttachmentPos[x][2] - gShipHullOrigin[2],
                    
0.00.00.0);
        
//new test[1000];
        //format(test, sizeof(test),"%f %f %f\n",gShipAttachmentPos[x][0]-gShipHullOrigin[0],gShipAttachmentPos[x][1]-gShipHullOrigin[1],gShipAttachmentPos[x][2]-gShipHullOrigin[2]);
        //print(test);
        
x++;
    }
    return 
1;
}
public 
OnFilterScriptExit()
{
    
DestroyObject(gMainShipObjectId);
    new 
x=0;
    
DestroyObject(holePlug);
    while(
!= NUM_SHIP_ATTACHMENTS)
    {
        
DestroyObject(gShipsAttachments[x]);
        
x++;
    }
    return 
1;
}
public 
OnObjectMoved(objectid)
{
    if(
objectid != gMainShipObjectId) return 0;
    
gShipCurrentPoint++;
    
//new tempdebug[256+1];
    //format(tempdebug,256,"Le ferry est au point : %d", gShipCurrentPoint);
    //SendClientMessageToAll(0xFFFFFFFF,tempdebug);
    
if(gShipCurrentPoint == NUM_SHIP_ROUTE_POINTS || gShipCurrentPoint == || gShipCurrentPoint == || gShipCurrentPoint == 6) {
        if(
gShipCurrentPoint == NUM_SHIP_ROUTE_POINTSgShipCurrentPoint 1;
        if(
gShipCurrentPoint == || gShipCurrentPoint == 4)
        {
            
// Before heading to the first route we should wait a bit
            
gettime(HourMinuteSecond);
            if(
gShipCurrentPoint == 1)
            {
                
SendClientMessageToAll(-1"{0065C2}-------------------------------------------------------------");
                
format(strFerrysizeof(strFerry), "{ffffff}O ferry irб partir de {0065C2}%s {ffffff}para {0065C2}%s{ffffff}, irб dar partida dentro de {0065C2}5 {ffffff}minutos.""Islandia""California");
                
// open dock CI
                
MoveObject(gShipRampCI2007.0, -3242.2863775.70517.18870.00.0); // show CI ramp
                
MoveObject(gShipFenceCI2007.541504, -3230.81347711.6318040.2, -6.2831840.0000000.000000); // hide CI fence
            
}
            if(
gShipCurrentPoint == 4)
            {
                
SendClientMessageToAll(-1"{0065C2}-------------------------------------------------------------");
                
format(strFerrysizeof(strFerry), "{ffffff}O ferry irб partir de {0065C2}%s {ffffff}para {0065C2}%s{ffffff}, irб dar partida dentro de {0065C2}5 {ffffff}minutos.""California""Iislandia");
                
// open dock LI
                
MoveObject(gShipRampLI6973.289063, -1454.7735603.452109517.18870.00000.0000); // show LI ramp
                
MoveObject(gShipFenceLI6973.238281, -1443.7423109.3144900.20.00000.00000.0000); // hide LI fence
            
}
            
SendClientMessageToAll(GREENstrFerry);
            
SendClientMessageToAll(-1"{0065C2}-------------------------------------------------------------");
            
SetTimer("BeforeMovingTimer",4*60*1000,0); // pause for 4 minutes
            
return 1;
        }
           
MoveObject(gMainShipObjectId,gShipRoutePoints[gShipCurrentPoint][0],
                               
gShipRoutePoints[gShipCurrentPoint][1],
                               
gShipRoutePoints[gShipCurrentPoint][2],
                               
SHIP_MOVE_SPEED 10.0// slower
                               
gShipRoutePoints[gShipCurrentPoint][3],
                               
gShipRoutePoints[gShipCurrentPoint][4],
                               
gShipRoutePoints[gShipCurrentPoint][5]);
        return 
1;
    }
    
MoveObject(gMainShipObjectId,gShipRoutePoints[gShipCurrentPoint][0],
                               
gShipRoutePoints[gShipCurrentPoint][1],
                               
gShipRoutePoints[gShipCurrentPoint][2],
                               
SHIP_MOVE_SPEED,
                               
gShipRoutePoints[gShipCurrentPoint][3],
                               
gShipRoutePoints[gShipCurrentPoint][4],
                               
gShipRoutePoints[gShipCurrentPoint][5]);
     return 
1;

Reply
#2

As suas Coordenadas pode estб erradas
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)