[Help] Giving error
#1

Good noite everyone, i have a error in my script.
Can someone help me please?
*I'm new to the forum, sorry if I'm posting this topic in the wrong place.

CODE

PHP Code:
CMD:roubarcaixa(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
        new 
string[128];
        new 
org GetPlayerOrg(playerid);
        if(
RoubouCaixa[playerid] > 0) {
            
format(string,sizeof(string), "Vocк jб roubou o caixa eletronico espere %d segundos.",RoubouCaixa[playerid]);
            return 
SendClientMessage(playerid, -1string); }
        if(
org == || org == 14 || org == 17 || org == 18)
        {
            if(!
GetPlayerCaixa(playerid))
                return 
SendClientMessage(playerid, -1"Vocк nгo estб em um caixa eletrуnico.");
            new 
count 0;
            new 
Float:pos[3]; GetPlayerPos(playeridpos[0], pos[1], pos[2]);
            for(new 
0MAX_PLAYERSi++) {
                if(
IsPlayerConnected(i)) { if(org[i] == org && PlayerToPoint(10.0,i,pos[0],pos[1],pos[2])) count ++; } }
            if(
count 2) return SendClientMessage(playerid, -1"ERRO: Para efetuar o roubo vocк nгo pode estar sozinho.");
            if(
PlayerToPoint(5.0,playerid,1186.30676, -1371.2263213.16235)) {
                return 
SendClientMessage(playerid, -1"ERRO: O Caixa eletronico nгo pode ser roubado."); }
            else if(
PlayerToPoint(2,playerid,1928.69604, -1784.0463913.15720)) { 
                if(
CaixaEletronicoTime[2] > 0) return SendClientMessage(playerid, -1"ERRO: O Caixa eletronico acabou de ser roubado.");
                
CaixaEletronicoTime[2] = 420; }
            else if(
PlayerToPoint(2,playerid,1837.20667, -1692.4482413.01124)) {
                if(
CaixaEletronicoTime[3] > 0) return SendClientMessage(playerid, -1"ERRO: O Caixa eletronico acabou de ser roubado.");
                
CaixaEletronicoTime[3] = 420; }
            else if(
PlayerToPoint(2playerid1815.42297, -1418.0617712.99400)) { 
                if(
CaixaEletronicoTime[4] > 0) return SendClientMessage(playerid, -1"ERRO: O Caixa eletronico acabou de ser roubado.");
                
CaixaEletronicoTime[4] = 420; }
            else if(
PlayerToPoint(2playerid1363.55298, -1750.6385513.17531)) { 
                if(
CaixaEletronicoTime[5] > 0) return SendClientMessage(playerid, -1"ERRO: O Caixa eletronico acabou de ser roubado.");
                
CaixaEletronicoTime[5] = 420; }
            else if(
PlayerToPoint(2playerid1070.77478, -1881.5437013.16587)) { 
                if(
CaixaEletronicoTime[6] > 0) return SendClientMessage(playerid, -1"ERRO: O Caixa eletronico acabou de ser roubado.");
                
CaixaEletronicoTime[6] = 420;
            }
            
SendClientMessage(playerid, -1,"* Espere 2 minutos para roubar o caixa eletronico!");
            
format(string,sizeof(string), "* %s estб tentando roubar o caixa eletronico.",Nome(playerid));
            
SendClientMessageInRange(15.0,playerid,string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4,1,0,0,0,0);
            
ApplyAnimation(playerid,"BOMBER","BOM_Plant",4,1,0,0,0,0);
            
SetTimerEx("roubarcaixa", (80000/3), false"i"playerid);
            
SetTimerEx("animacaobomb"1000false"i"playerid);
            
RoubouCaixa[playerid] = 1200;
        }
        else 
SendClientMessage(playerid, -1"Vocк nao й membro de uma gangue.");
    }
    return 
1;

ERROR

Quote:

error 028: invalid subscript (not an array or too many subscripts): "org"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Error Line

Quote:

if(IsPlayerConnected(i)) { if(org[i] == org && PlayerToPoint(10.0,i,pos[0],pos[1],pos[2])) count ++; } }

Reply
#2

First of all that code is unreadable.Secondly org variable is not an array but you trying to use subscript operators([ and ] ) with it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)