[Ajuda] Sistema /cinto
#1

O meu sistema de cinto estб-me a dar vбrios problemas, alguйm me pode ajudar?
PHP код:
(110) : error 001expected token"-identifier-"but found "/"
(112) : error 010invalid function or declaration
(114) : error 010invalid function or declaration
(116) : error 010invalid function or declaration
(123) : error 054unmatched closing brace ("}")
(
124) : error 010invalid function or declaration
(129) : error 010invalid function or declaration
(133) : error 010invalid function or declaration
(136) : error 010invalid function or declaration
(138) : error 010invalid function or declaration
(140) : error 010invalid function or declaration
(147) : error 054unmatched closing brace ("}")
(
148) : error 010invalid function or declaration
(153) : error 010invalid function or declaration
(157) : error 010invalid function or declaration
(160) : error 010invalid function or declaration
(199) : error 017undefined symbol "ModelID"
(215) : error 017undefined symbol "ModelID"
(216) : error 017undefined symbol "ox"
(216) : warning 213tag mismatch
(217) : error 017undefined symbol "oy"
(217) : warning 213tag mismatch
(218) : error 017undefined symbol "oz"
(218) : warning 213tag mismatch
(219) : error 017undefined symbol "orx"
(219) : warning 213tag mismatch
(220) : error 017undefined symbol "ory"
(220) : warning 213tag mismatch
(221) : error 017undefined symbol "orz"
(221) : warning 213tag mismatch
(222) : error 017undefined symbol "ovdist"
(222) : warning 213tag mismatch
(227) : error 017undefined symbol "ModelID"
Compilation aborted.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
26 Errors

PHP код:
{
/
cinto e /tirarcinto
    
//====================================[Cinto=========================================
            
if(!strcmp(cmdtext"/cinto"true))
        {
  if(
IsPlayerInAnyVehicle(playerid))
            {
                if(
CintoPlayer[playerid] == 0)
            {
                
CintoPlayer[playerid] = 1;
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
SendClientMessage(playeridCOLOR_YELLOW,"[BHF] Parabйns Vocк estб de Cinto, Agora Estб Protegido (/tirarcinto)");
                
format(stringsizeof(string), "%s coloca o cinto de seguranзa."sendername);
                            
ProxDetector(10.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else
                {
                
SendClientMessage(playeridCOLOR_YELLOW,"[BHF] Vocк jб estб de cinto.");
            }
        }
        else
        {
               
SendClientMessage(playeridCOLOR_WHITE,"Vocк nгo estб em um Veiculo");
            }
        return 
1;
        }
    
//===================================================================
        
if(!strcmp(cmdtext"/tirarcinto"true))
        {
        if(
IsPlayerInAnyVehicle(playerid))
        {
            if(
CintoPlayer[playerid] == 1)
            {
                
CintoPlayer[playerid] = 0;
                
GetPlayerName(playeridsendernamesizeof(sendername));
                
SendClientMessage(playeridCOLOR_YELLOW,"[BHF] Cuidado Vocк Esta Sem Cinto, Pode Morrer (/cinto)");
                
format(stringsizeof(string), "%s retira o cinto de seguranзa."sendername);
                            
ProxDetector(10.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            }
            else
            {
                
SendClientMessage(playeridCOLOR_YELLOW,"[BHF] Vocк jб estб sem cinto.");
            }
        }
            else
            {
        
SendClientMessage(playeridCOLOR_YELLOW,"[BSG] Vocк nгo estб em um veнculo.");
        }
        return 
1;
        }
    
ModelID,
    
ObjectID[MAX_PLAYERS],
    
Float:ox,
    
Float:oy,
    
Float:oz,
    
Float:orx,
    
Float:ory,
    
Float:orz,
    
Float:ovdist,
    
bool:ObjectCreated[MAX_PLAYERS],
}
new 
ObjectInfo[Ilde_MAX_OBJECTS][OInfo];
new 
bool:ObjectUpdatetRunning;
new 
bool:CantCreateMore;
new 
bool:RefreshObjects[MAX_PLAYERS];
new 
Float:OldX[MAX_PLAYERS], Float:OldY[MAX_PLAYERS], Float:OldZ[MAX_PLAYERS];
forward Ilde_ObjectUpdate(bool:DontCheckDistance);
forward Ilde_StartUpdate();
public 
Ilde_StartUpdate()
{
    
SetTimer("Ilde_ObjectUpdate"UpdateTime1);
}
stock Ilde_CreateObject(modelidFloat:xFloat:yFloat:zFloat:rxFloat:ryFloat:rzFloat:vdist=0.0)
{
    if(
ObjectUpdatetRunning == false)
    {
        
SetTimer("Ilde_StartUpdate"Ilde_MAX_OBJECTS/20);
        
ObjectUpdatetRunning true;
    }
 new 
objectid;
    if(
CantCreateMore == false)
    {
        for(new 
ii<Ilde_MAX_OBJECTSi++)
        {
            if(
== Ilde_MAX_OBJECTS-1)
            {
                
printf("Only the first %i objects could be created - object limit exceeded."Ilde_MAX_OBJECTS);
                
CantCreateMore true;
            }
            if(
ObjectInfo[i][ModelID] == 0)
            {
                
objectid i;
                break;
            }
        }
    }
    else
    {
        return -
1;
    }
    if(
modelid == 0)
    {
        
printf("Invalid modelid for object %i"objectid);
        return -
1;
    }
    
ObjectInfo[objectid][ModelID] = modelid;
    
ObjectInfo[objectid][ox] = x;
    
ObjectInfo[objectid][oy] = y;
    
ObjectInfo[objectid][oz] = z;
    
ObjectInfo[objectid][orx] = rx;
    
ObjectInfo[objectid][ory] = ry;
    
ObjectInfo[objectid][orz] = rz;
    
ObjectInfo[objectid][ovdist] = vdist;
    return 
objectid;
}
stock Ilde_IsValidObject(objectid)
{
    if(
ObjectInfo[objectid][ModelID] == || objectid == -1)
    {
        return 
0;
    }
    return 
1;

Reply
#2

vocк nгo criou as variбveis
Reply
#3

Vocк criou o comando dentro de uma array e por isso bugou tudo.....

corrigindo:
Код:
{
    ModelID,
    ObjectID[MAX_PLAYERS],
    Float:ox,
    Float:oy,
    Float:oz,
    Float:orx,
    Float:ory,
    Float:orz,
    Float:ovdist,
    bool:ObjectCreated[MAX_PLAYERS],
}
new ObjectInfo[Ilde_MAX_OBJECTS][OInfo];
new bool:ObjectUpdatetRunning;
new bool:CantCreateMore;
new bool:RefreshObjects[MAX_PLAYERS];
new Float:OldX[MAX_PLAYERS], Float:OldY[MAX_PLAYERS], Float:OldZ[MAX_PLAYERS];
forward Ilde_ObjectUpdate(bool:DontCheckDistance);
forward Ilde_StartUpdate();
public Ilde_StartUpdate()
{
    SetTimer("Ilde_ObjectUpdate", UpdateTime, 1);
}
stock Ilde_CreateObject(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:vdist=0.0)
{
    if(ObjectUpdatetRunning == false)
    {
        SetTimer("Ilde_StartUpdate", Ilde_MAX_OBJECTS/2, 0);
        ObjectUpdatetRunning = true;
    }
 new objectid;
    if(CantCreateMore == false)
    {
        for(new i; i<Ilde_MAX_OBJECTS; i++)
        {
            if(i == Ilde_MAX_OBJECTS-1)
            {
                printf("Only the first %i objects could be created - object limit exceeded.", Ilde_MAX_OBJECTS);
                CantCreateMore = true;
            }
            if(ObjectInfo[i][ModelID] == 0)
            {
                objectid = i;
                break;
            }
        }
    }
    else
    {
        return -1;
    }
    if(modelid == 0)
    {
        printf("Invalid modelid for object %i", objectid);
        return -1;
    }
    ObjectInfo[objectid][ModelID] = modelid;
    ObjectInfo[objectid][ox] = x;
    ObjectInfo[objectid][oy] = y;
    ObjectInfo[objectid][oz] = z;
    ObjectInfo[objectid][orx] = rx;
    ObjectInfo[objectid][ory] = ry;
    ObjectInfo[objectid][orz] = rz;
    ObjectInfo[objectid][ovdist] = vdist;
    return objectid;
}
stock Ilde_IsValidObject(objectid)
{
    if(ObjectInfo[objectid][ModelID] == 0 || objectid == -1)
    {
        return 0;
    }
    return 1;
}
E o comando tem que estar dentro da OnPlayerCommandText.
Reply
#4

Obrigado gabriel, jб resolveu!
Reply


Forum Jump:


Users browsing this thread: