Getting bunch of errors
#1

Hi guys.
Im getting errors on my script that say undefined variable however the variables that it gives error on its ServerPassword and all that stuff. I have done a command and after that it started showing up those errors. i have been looking if there is any { or } missing but i didnt see any. Is there a way to find out where is the error?

cumpz,
vasco
Reply
#2

Have you tried removing everything you changed when this happened?
If you know what makes this happen, please post it here, otherwise we can't do much.
Reply
#3

just remove last "}" you added
Reply
#4

How do you know that without looking to his script?
Reply
#5

PHP код:
if(strcmp(cmd,"/encomendarmats",true) == 0)
        {
            if (
PlayerInfo[playerid][pFaction] != 4)
            {
                  
format(stringsizeof(string), "{FF0000}[Erro]: {FFFFFF}Nгo йs da faction que trafica armas!");
                
SendClientMessage(playeridCOLOR_WHITEstring);
                 return 
1;
            }
            if(
PlayerInfo[playerid][pRank] > 3)
                {
                            
SendClientMessage(playeridCOLOR_RED,"{FF0000}[Erro]: {FFFFFF}Apenas cargo 3 ou superior pode usar este comando.");
                            return 
1;
                }
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_LIGHTRED,"{ADFF2F}[Comando]: {FFFFFF} /encomendarmats [quantidade]");
                    
//SendClientMessage(playerid, COLOR_WHITE, "");
                    
return 1;
                }
                
mats strtok(cmdtextidx);
                if(
mats <= 50 && mats >= 1)
                {
                    new 
deliveryplane;
                    
deliverprogress 1;
                    
precomats 100*mats;
                    
CreateDynamicCP(1022.8339,241.7309,33.0816,5.0,0,0,playerid,4600);
                    
deliveryplane CreateVehicle(512,-13.0069,-122.7030,2.0356,85.8541,0,0,0);
                    
SetTimerEx("deliverprogress"300000false"ii"playeriddeliveryplane);
                    new 
deliverystring[200];
                    
format(string,sizeof(string), "[Telefone:] Acordo aceite. Estaremos no local de entrega com os seus materiais em 5 minutos");
                    
SendClientMessage(playeridCOLOR_WHITEstring);
                }
        return 
1;
        } 
PHP код:
if(PlayerToPoint(5.0,playerid1022.8339,241.7309,33.0816)
    {
        if(
deliverprogress == 1)
        {
            if(
arrival == 1)
            {
                if(
GetPlayerEuros(playerid) >= preco)
                {
                    
PlayerInfo[playerid][pMaterials] += mats;
                    
GivePlayerEuros(playerid, -preco);
                    new 
pagarencomenda[128];
                    
format(pagarencomenda,sizeof(pagarencomenda), "[Vendedor] Foi um prazer negociar. Se precisares de algo mais nao exites em chamar me!");
                    
SendClientMessage(playeridCOLOR_WHITEpagarencomenda);
                    new 
infopago[128];
                    
format(infopago,sizeof(infopago), "Pagaste %d$ por %d materiais. Nao te esqueзas que ainda os tens que entregar ao teu trabalhador!"precomats);
                    
DisablePlayerCheckpoint(playerid);
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_WHITE"[Vendedor] Mas estas maluco?! Este preco nao foi o que negociamos. Volta quando tiveres o dinheiro");
                return 
1;
                }
            else
            {
                
SendClientMessage(playeridCOLOR_RED"[ERRO] Espera que o vendedor chegue!");
                return 
1;
            }
        else
        {
        return 
1;
        }
    } 
PHP код:
forward deliverprogress(playeriddeliveryplane);
public 
deliverprogress(playeriddeliveryplane)
{
    
PutNPCInVehicle(deliveryguydeliveryplane1);
    
SetTimerEx("chegadaheli"25000false"i"playerid);
    
SendClientMessage(playeridCOLOR_WHITE"[Telemovel] Anuncio que a sua entrega esta prestes a chegar. Por favor dirija-se para o local de entrega.");
}
forward chegadaheli(playerid);
public 
chegadaheli(playerid)
{
    
arrival 1;

Reply
#6

Quote:

if(deliverprogress == 1)
{

is not closed in the second code
Reply
#7

Sreyas is correct.

If you had proper indentation it would be very easy to find this. Learn how to properly indent your code before doing anything else, it's very important. Hell, languages such as Python rely on proper indentation for the infrastructure.
Reply
#8

Ok thanks guys. I'm just 14 and my brother tells me im already doing some really good systems so im sorry i have to organize myself better :S but rly thanks
Reply
#9

Why not doing commands in YCMD and ZCMD?? It is faster that way
Reply
#10

Well idk how to use zcmd or ycmd i prefer learning strcmp better first then jumping to those right away
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)