[Ajuda] Bugando tudo
#1

Bom galera eu eu gostaria de saber se o codigo fica asim cousa algum bug no gm
PHP код:
    if(newkeys == KEY_SECONDARY_ATTACK// Tecla » [ \| ]
    
{
    new 
Floatdistance_ 1.0;
    if(
IsPlayerInRangeOfPoint(playeriddistance_2072.5137,2060.8616,10.8445) || IsPlayerInRangeOfPoint(playeriddistance_2072.4607,2059.4314,10.8445) ||
    
IsPlayerInRangeOfPoint(playeriddistance_2072.8223,2058.2295,10.8445) ||  IsPlayerInRangeOfPoint(playeriddistance_2072.4287,2056.8879,10.8445) ||
    
IsPlayerInRangeOfPoint(playeriddistance_2072.8479,2055.6711,10.8445))
    { 
Reply
#2

Se vocк ta falando dos inъmeros || no seu if(), nгo creio que serб problema, porйm evite colocar mais do que isso porque levarб mais tempo para o cуdigo ser verificado e executado.
Reply
#3

Quote:
Originally Posted by henrique22157
Посмотреть сообщение
Bom galera eu eu gostaria de saber se o codigo fica asim cousa algum bug no gm
PHP код:
    if(newkeys == KEY_SECONDARY_ATTACK// Tecla » [ \| ]
    
{
    new 
Floatdistance_ 1.0;
    if(
IsPlayerInRangeOfPoint(playeriddistance_2072.5137,2060.8616,10.8445) || IsPlayerInRangeOfPoint(playeriddistance_2072.4607,2059.4314,10.8445) ||
    
IsPlayerInRangeOfPoint(playeriddistance_2072.8223,2058.2295,10.8445) ||  IsPlayerInRangeOfPoint(playeriddistance_2072.4287,2056.8879,10.8445) ||
    
IsPlayerInRangeOfPoint(playeriddistance_2072.8479,2055.6711,10.8445))
    { 
nada está errado, mas é mais fácil escrever se for possível!

Код:
if(newkeys == KEY_SECONDARY_ATTACK && IsPlayerInRangeOfPoint(playerid, 100, 2072.5137,2060.8616,10.8445))
{
Reply
#4

Quote:
Originally Posted by DroctorShift
Посмотреть сообщение
nada estб errado, mas й mais fбcil escrever se for possнvel!

Код:
if(newkeys == KEY_SECONDARY_ATTACK && IsPlayerInRangeOfPoint(playerid, 100, 2072.5137,2060.8616,10.8445))
{
Tipo eu estava feririfcndo aki no meu gm e esse codigos estгo cousando uns bug eu tirei eles saiu o bug
PHP код:
/*
    if(newkeys == KEY_SECONDARY_ATTACK) // Tecla » [ \| ]
    {
    new Float: distance_ = 1.0;
    if(IsPlayerInRangeOfPoint(playerid, distance_, 2072.5137,2060.8616,10.8445) || IsPlayerInRangeOfPoint(playerid, distance_, 2072.4607,2059.4314,10.8445) ||
    IsPlayerInRangeOfPoint(playerid, distance_, 2072.8223,2058.2295,10.8445) ||  IsPlayerInRangeOfPoint(playerid, distance_, 2072.4287,2056.8879,10.8445) ||
    IsPlayerInRangeOfPoint(playerid, distance_, 2072.8479,2055.6711,10.8445))
    {
        if(Player[playerid][pPMRJ] >= 1 || Player[playerid][pBOPE] >= 1 || Player[playerid][pCORE] >= 1)return SendClientMessage(playerid, COR_ERRO, "ERRO: Policial nгo rouba banco ;)");
        if(Player[playerid][pTempoBanco] >= 1)
        {
           SendFormattedMessage(playerid, COR_ERRO, "ERRO: Vocк jб roubou o banco recentemente, espere %s.", Convert(Player[playerid][pTempoBanco]));
           return 1;
        }
        static Ladrao[MAX_PLAYER_NAME], sStr[70];
        new Float:Pos[3];
        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
        Player[playerid][pProcurado] += 1;
        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
        GetPlayerName(playerid, Ladrao, sizeof(Ladrao));
        if(Roubando[playerid] == 1) return SendClientMessage(playerid, 0xE31919FF, "[~] Vocк jб estб assaltando!");
        format(sStr, sizeof(sStr), "[NOTНCIAS] %s[%d] Plantou uma Bomba no Caixa Eletrуnico!", Ladrao, playerid);
        SendClientMessageToAll(0xE31919FF, sStr);
        Bomba = CreateObject(1252, Pos[0], Pos[1], Pos[2] - 0.8,270,0,0);
        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
        format(sStr, sizeof(sStr), "Espere no local %d minutos para concluir o saqueamento!", TempoRoubo);
        SendClientMessage(playerid, 0xC9C9C9FF, sStr);
        SendClientMessage(playerid, 0xFF7777AA, "{A2CD5A}Vocк foi feito um procurado da justiзa. | Crime: 157.");
        SetTimerEx("Roubou", 30000*TempoRoubo,false,"d", playerid);
        Roubando[playerid] = 1;
        new city[64] = "Nгo identificado";
        new string[100];
        switch(GetPlayerCity(playerid))
        {
            case CITY_LS: city = "Los Santos";
            case CITY_SF: city = "San Fierro";
            case CITY_LV: city = "Las Venturas";
        }
        format(string,sizeof(string),"COPOM:{FFFFFF} Chamando Todas As Ъnidades, Cameras de segueranзa do banco acaba de flaga um suspeito");
        SendMessageToCops(0xFF0000AA, string);
        format(string,sizeof(string),"{FFFFFF}COPOM: Crime: {EE0000}%s {ffffff}| Suspeito: {EE0000}%s {ffffff}(ID:%d) | Local: {8B864E}%s.", getPName(playerid), city);
        SendMessageToCops(0xFF0000AA, string);
        SalvarPlayer(playerid);
    }
    return 1;
}
*/ 
Eu queria organizar esse codigo
PHP код:
    if(newkeys == KEY_SECONDARY_ATTACK// Tecla » [ \| ]
    
{
    new 
Floatdistance_ 1.0;
    if(
IsPlayerInRangeOfPoint(playeriddistance_2072.5137,2060.8616,10.8445) || IsPlayerInRangeOfPoint(playeriddistance_2072.4607,2059.4314,10.8445) ||
    
IsPlayerInRangeOfPoint(playeriddistance_2072.8223,2058.2295,10.8445) ||  IsPlayerInRangeOfPoint(playeriddistance_2072.4287,2056.8879,10.8445) ||
    
IsPlayerInRangeOfPoint(playeriddistance_2072.8479,2055.6711,10.8445)) 
Alguem?
Reply
#5

Vocк organizar desta forma:
PHP код:
new Float:PosCX[][] =
{
    {
2072.5137,2060.8616,10.8445},
    {
2072.4607,2059.4314,10.8445},
    {
2072.4287,2056.8879,10.8445},
    {
2072.8479,2055.6711,10.8445},
    {
2072.8223,2058.2295,10.8445}
}; 
PHP код:
if(newkeys == KEY_SECONDARY_ATTACK)
{
      for(new 
0sizeof PosCX; ++ i)
      {
            if(
IsPlayerInRangeOfPoint(playerid1.0PosCX[i][0], PosCX[i][1], PosCX[i][2]))
        {
              
// code
        
}
      }
     return 
true;

Reply
#6

Quote:
Originally Posted by PilateGR
Посмотреть сообщение
Vocк organizar desta forma:
PHP код:
new Float:PosCX[][] =
{
    {
2072.5137,2060.8616,10.8445},
    {
2072.4607,2059.4314,10.8445},
    {
2072.4287,2056.8879,10.8445},
    {
2072.8479,2055.6711,10.8445},
    {
2072.8223,2058.2295,10.8445}
}; 
PHP код:
if(newkeys == KEY_SECONDARY_ATTACK)
{
      for(new 
0sizeof PosCX; ++ i)
      {
            if(
IsPlayerInRangeOfPoint(playerid1.0PosCX[i][0], PosCX[i][1], PosCX[i][2]))
        {
              
// code
        
}
      }
     return 
true;

PHP код:
new Float:PosCX[][] =
{
    {
2072.5137,2060.8616,10.8445},
    {
2072.4607,2059.4314,10.8445},
    {
2072.4287,2056.8879,10.8445},
    {
2072.8479,2055.6711,10.8445},
    {
2072.8223,2058.2295,10.8445}
}; 
PHP код:
if(newkeys == KEY_SECONDARY_ATTACK)
{
      for(new 
0sizeof PosCX; ++ i)
      {
            if(
IsPlayerInRangeOfPoint(playerid1.0PosCX[i][0], PosCX[i][1], PosCX[i][2]))
        {
        if(
Player[playerid][pPMRJ] >= || Player[playerid][pBOPE] >= || Player[playerid][pCORE] >= 1)return SendClientMessage(playeridCOR_ERRO"ERRO: Policial nгo rouba banco ;)");
        if(
Player[playerid][pTempoBanco] >= 1)
        {
           
SendFormattedMessage(playeridCOR_ERRO"ERRO: Vocк jб roubou o banco recentemente, espere %s."Convert(Player[playerid][pTempoBanco]));
           return 
1;
        }
        static 
Ladrao[MAX_PLAYER_NAME], sStr[70];
        new 
Float:Pos[3];
        
SetPlayerWantedLevel(playeridGetPlayerWantedLevel(playerid) + 1);
        
Player[playerid][pProcurado] += 1;
        
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
        
GetPlayerName(playeridLadraosizeof(Ladrao));
        if(
Roubando[playerid] == 1) return SendClientMessage(playerid0xE31919FF"[~] Vocк jб estб assaltando!");
        
format(sStrsizeof(sStr), "[NOTНCIAS] %s[%d] Plantou uma Bomba no Caixa Eletrуnico!"Ladraoplayerid);
        
SendClientMessageToAll(0xE31919FFsStr);
        
Bomba CreateObject(1252Pos[0], Pos[1], Pos[2] - 0.8,270,0,0);
        
ApplyAnimation(playerid"BOMBER""BOM_Plant"4.000000);
        
format(sStrsizeof(sStr), "Espere no local %d minutos para concluir o saqueamento!"TempoRoubo);
        
SendClientMessage(playerid0xC9C9C9FFsStr);
        
SendClientMessage(playerid0xFF7777AA"{A2CD5A}Vocк foi feito um procurado da justiзa. | Crime: 157.");
        
SetTimerEx("Roubou"30000*TempoRoubo,false,"d"playerid);
        
Roubando[playerid] = 1;
        new 
city[64] = "Nгo identificado";
        new 
string[100];
        switch(
GetPlayerCity(playerid))
        {
            case 
CITY_LScity "Los Santos";
            case 
CITY_SFcity "San Fierro";
            case 
CITY_LVcity "Las Venturas";
        }
        
format(string,sizeof(string),"COPOM:{FFFFFF} Chamando Todas As Ъnidades, Cameras de segueranзa do banco acaba de flaga um suspeito");
        
SendMessageToCops(0xFF0000AAstring);
        
format(string,sizeof(string),"{FFFFFF}COPOM: Crime: {EE0000}%s {ffffff}| Suspeito: {EE0000}%s {ffffff}(ID:%d) | Local: {8B864E}%s."getPName(playerid), city);
        
SendMessageToCops(0xFF0000AAstring);
        
SalvarPlayer(playerid);
    }
    return 
1;

Quote:

C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(1544) : error 017: undefined symbol "SalvarLog"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(1545) : error 017: undefined symbol "SetarArmas"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(1546) : error 017: undefined symbol "SetarCifrao"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(1563) : error 017: undefined symbol "LoadConfig"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(6927) : error 017: undefined symbol "SalvarPlayer"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(6932) : error 017: undefined symbol "SalvarDadosOrgsCops"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(6933) : error 017: undefined symbol "GuardarArmas"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(6934) : error 017: undefined symbol "GuardarCifrao"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(6944) : error 017: undefined symbol "getPName"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(6951) : error 017: undefined symbol "getPName"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(695 : error 017: undefined symbol "getPName"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7007) : error 017: undefined symbol "AntiDeAMX"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7016) : error 017: undefined symbol "isStringSame"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7034) : error 017: undefined symbol "GetBannedFile"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7034) : error 033: array must be indexed (variable "banfile")
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7050) : error 017: undefined symbol "Convert"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7070) : error 017: undefined symbol "GetBannedFile2"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7070) : error 033: array must be indexed (variable "banfile")
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7086) : error 017: undefined symbol "Convert"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7092) : error 017: undefined symbol "GetBannedFile"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7092) : error 033: array must be indexed (variable "ipfile")
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7112) : error 017: undefined symbol "GetPlayerFile"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7112) : error 033: array must be indexed (variable "file")
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(713 : error 017: undefined symbol "CreateMapIcons"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7295) : error 017: undefined symbol "AdvanceSpectate"
C:\Users\Henrique Guedes\Desktop\GameMode\gamemodes\gamemodehenrique .pwn(7320) : error 017: undefined symbol "VerificarRival"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.

Reply
#7

Quote:
Originally Posted by henrique22157
Посмотреть сообщение
PHP код:
new Float:PosCX[][] =
{
    {
2072.5137,2060.8616,10.8445},
    {
2072.4607,2059.4314,10.8445},
    {
2072.4287,2056.8879,10.8445},
    {
2072.8479,2055.6711,10.8445},
    {
2072.8223,2058.2295,10.8445}
}; 
PHP код:
if(newkeys == KEY_SECONDARY_ATTACK)
{
      for(new 
0sizeof PosCX; ++ i)
      {
            if(
IsPlayerInRangeOfPoint(playerid1.0PosCX[i][0], PosCX[i][1], PosCX[i][2]))
        {
        if(
Player[playerid][pPMRJ] >= || Player[playerid][pBOPE] >= || Player[playerid][pCORE] >= 1)return SendClientMessage(playeridCOR_ERRO"ERRO: Policial nгo rouba banco ;)");
        if(
Player[playerid][pTempoBanco] >= 1)
        {
           
SendFormattedMessage(playeridCOR_ERRO"ERRO: Vocк jб roubou o banco recentemente, espere %s."Convert(Player[playerid][pTempoBanco]));
           return 
1;
        }
        static 
Ladrao[MAX_PLAYER_NAME], sStr[70];
        new 
Float:Pos[3];
        
SetPlayerWantedLevel(playeridGetPlayerWantedLevel(playerid) + 1);
        
Player[playerid][pProcurado] += 1;
        
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
        
GetPlayerName(playeridLadraosizeof(Ladrao));
        if(
Roubando[playerid] == 1) return SendClientMessage(playerid0xE31919FF"[~] Vocк jб estб assaltando!");
        
format(sStrsizeof(sStr), "[NOTНCIAS] %s[%d] Plantou uma Bomba no Caixa Eletrуnico!"Ladraoplayerid);
        
SendClientMessageToAll(0xE31919FFsStr);
        
Bomba CreateObject(1252Pos[0], Pos[1], Pos[2] - 0.8,270,0,0);
        
ApplyAnimation(playerid"BOMBER""BOM_Plant"4.000000);
        
format(sStrsizeof(sStr), "Espere no local %d minutos para concluir o saqueamento!"TempoRoubo);
        
SendClientMessage(playerid0xC9C9C9FFsStr);
        
SendClientMessage(playerid0xFF7777AA"{A2CD5A}Vocк foi feito um procurado da justiзa. | Crime: 157.");
        
SetTimerEx("Roubou"30000*TempoRoubo,false,"d"playerid);
        
Roubando[playerid] = 1;
        new 
city[64] = "Nгo identificado";
        new 
string[100];
        switch(
GetPlayerCity(playerid))
        {
            case 
CITY_LScity "Los Santos";
            case 
CITY_SFcity "San Fierro";
            case 
CITY_LVcity "Las Venturas";
        }
        
format(string,sizeof(string),"COPOM:{FFFFFF} Chamando Todas As Ъnidades, Cameras de segueranзa do banco acaba de flaga um suspeito");
        
SendMessageToCops(0xFF0000AAstring);
        
format(string,sizeof(string),"{FFFFFF}COPOM: Crime: {EE0000}%s {ffffff}| Suspeito: {EE0000}%s {ffffff}(ID:%d) | Local: {8B864E}%s."getPName(playerid), city);
        
SendMessageToCops(0xFF0000AAstring);
        
SalvarPlayer(playerid);
    }
    return 
1;

Ver ai:
Код:
if(newkeys == KEY_SECONDARY_ATTACK)
{
    new Float:Pos[3], sStr[70], city[64] = "Nгo identificado";
	for(new i = 0; i < sizeof PosCX; ++ i)
 	{
  		if(IsPlayerInRangeOfPoint(playerid, 1.0, PosCX[i][0], PosCX[i][1], PosCX[i][2]))
        {
        	if(Player[playerid][pPMRJ] >= 1 || Player[playerid][pBOPE] >= 1 || Player[playerid][pCORE] >= 1)return SendClientMessage(playerid, COR_ERRO, "ERRO: Policial nгo rouba banco ;)");
        	if(Player[playerid][pTempoBanco] >= 1) return SendFormattedMessage(playerid, COR_ERRO, "ERRO: Vocк jб roubou o banco recentemente, espere %s.", Convert(Player[playerid][pTempoBanco]));
            if(Roubando[playerid] == 1) return SendClientMessage(playerid, 0xE31919FF, "[~] Vocк jб estб assaltando!");
            
	        SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
	        Player[playerid][pProcurado] += 1;
	        GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
         	Bomba = CreateObject(1252, Pos[0], Pos[1], Pos[2] - 0.8,270,0,0);
	        ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0);
	        SetTimerEx("Roubou", 30000*TempoRoubo,false,"d", playerid);
	        Roubando[playerid] = 1;
	        
	        format(sStr, sizeof(sStr), "[NOTНCIAS] %s[%d] Plantou uma Bomba no Caixa Eletrуnico!", Nome(playerid), playerid);
	        SendClientMessageToAll(0xE31919FF, sStr);
	       
	        format(sStr, sizeof(sStr), "Espere no local %d minutos para concluir o saqueamento!", TempoRoubo);
	        SendClientMessage(playerid, 0xC9C9C9FF, sStr);
	        
	        SendClientMessage(playerid, 0xFF7777AA, "{A2CD5A}Vocк foi feito um procurado da justiзa. | Crime: 157.");
	        
	        new string[100];
	        switch(GetPlayerCity(playerid))
	        {
	            case CITY_LS: city = "Los Santos";
	            case CITY_SF: city = "San Fierro";
	            case CITY_LV: city = "Las Venturas";
	        }
	        format(string,sizeof(string),"COPOM:{FFFFFF} Chamando Todas As Ъnidades, Cameras de segueranзa do banco acaba de flaga um suspeito");
	        SendMessageToCops(0xFF0000AA, string);
	        format(string,sizeof(string),"{FFFFFF}COPOM: Crime: {EE0000}%s {ffffff}| Suspeito: {EE0000}%s {ffffff}(ID:%d) | Local: {8B864E}%s.", getPName(playerid), city);
	        SendMessageToCops(0xFF0000AA, string);
    	}
	}
    return 1;
}
@EDIT
Tive verificando, e o erro й de chave, dei uma olhada no code, e aparentemente estб okay!
- Tambйm fiz minimas alteraзхes, recopile !
- Aqui foi ok...
https://i.imgur.com/q480248.png
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)