Fail by error..
#1

It's an erro which i don't understand.

My script:

PHP код:
if (strcmp(cmd"/goto"true) == 0)
    {
            new 
tmp[30];
               
tmp strtok(cmdtextidx);
               new 
otherid;
               
otherid strval(tmp);
       
               if(
UserStats[playerid][Admin] >= 2)
               {
                   if(
IsPlayerConnected(otherid) && otherid != INVALID_PLAYER_ID && otherid != playerid)
                   {
                       new 
Float:posxFloat:posyFloat:posz;
                       
GetPlayerPos(otherid,posx,posy,posz);
                    
SetPlayerInterior(playerid,GetPlayerInterior(otherid));
                    
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(otherid));
                       if (
GetPlayerState(playerid) == 2)
                    {
                            new 
car GetPlayerVehicleID(playerid);
                            
SetVehiclePos(carposxposy+4posz);
                    }
                    else { 
SetPlayerPos(playerid,posx,posy+2posz); } } // When i delete one of this brackets I get much errors.. You known: The bracket-error :(
                
else
                { 
SendClientMessage(playeridCOLOR_RED"Fehler: Spieler nicht gefunden oder eigene ID!"); }
            else 
// Here ist the error!
            
SendClientMessage(playeridCOLOR_RED"Du bist kein Administrator!"); }
        }
                   return 
1;
    } 
The error:
Код:
***********************(289) : error 029: invalid expression, assumed zero
Reply
#2

pawn Код:
{ SendClientMessage(playerid, COLOR_RED, "Du bist kein Administrator!"); }
                   return 1;
    }
Reply
#3

I get 20 errors when i change the bracket.. it's this bracket fail. Help?
Reply
#4

What line is the 289?
Reply
#5

pawn Код:
if (strcmp(cmd, "/goto", true) == 0)
{
    new tmp[30];
    tmp = strtok(cmdtext, idx);
    new otherid;
    otherid = strval(tmp);

    if(UserStats[playerid][Admin] >= 2)
    {
        if(IsPlayerConnected(otherid) && otherid != INVALID_PLAYER_ID && otherid != playerid)
        {
            new Float:posx, Float:posy, Float:posz;
            GetPlayerPos(otherid,posx,posy,posz);
            SetPlayerInterior(playerid,GetPlayerInterior(otherid));
            SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(otherid));

            if (GetPlayerState(playerid) == 2)
            {
                new car = GetPlayerVehicleID(playerid);
                SetVehiclePos(car, posx, posy+4, posz);
            }
            else
            {
                SetPlayerPos(playerid,posx,posy+2, posz);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "Fehler: Spieler nicht gefunden oder eigene ID!");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "Du bist kein Administrator!");
    }
    return 1;
}

I fixed the indentation & the error. Should work now.
Try it out.

Greetz.
Reply
#6

Thanks works!
Reply
#7

Quote:
Originally Posted by XCarBOn
Посмотреть сообщение
Thanks works!
Nice, and Thanks for the feedback.
Many people are not giving a feedback, and I think thats not fair.
I am always happy about a feedback.

Have fun.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)