ZCMD error
#1

Hi, i have 1 error: this cmd works fine until 'tagas <1 ', but then 'tagas' is more than 1 then i get error : 'Server: command don't exist' (something like that). So maybe u can help me to find what is missing?
pawn Код:
CMD:graffiti(playerid, params[])
    {
    if (tagas >= MAX_TAGS)
            return SendClientMessage(playerid,RAUDONA,">>Limitas isnaudotas");
    new id = random(8), piesinys,
        Float:ox, Float:oy, Float:oz,
        Float:x, Float:y, Float:z, Float:Angle;
    switch(id)
        {
        case 0 : piesinys =18659;
        case 1 : piesinys =18660;
        case 2 : piesinys =18661;
        case 3 : piesinys =18662;
        case 4 : piesinys =18663;
        case 5 : piesinys =18664;
        case 6 : piesinys =18665;
        case 7 : piesinys =18666;
        case 8 : piesinys =18667;
        }
    GetPlayerPos(playerid, x, y, z);
    if (tagas > 1)
        {
        for (new i=0;i<=MAX_TAGS;i++)
            {
            GetObjectPos(graffiti[i],ox,oy,oz);
            if (IsPlayerInRangeOfPoint(playerid,10,ox,oy,oz))
                {
                DestroyObject(graffiti[i]);
                }
             }
        }
    GetPlayerFacingAngle(playerid, Angle);
    GetXYInFrontOfPlayer(playerid, x, y,1.0);
    graffiti[tagas] =CreateObject(piesinys, x, y ,z + 0.5, 0.0,0.0,Angle-270, 96.0);
    SendClientMessage(playerid, 0x0080FFFF, "Tagas nupiestas");
    tagas++;
    return 1;
    }
Reply
#2

I tried..nothing...
this 'tagas++' is necessary because i need limit of them.
P.S. I edited script.
Reply
#3

pawn Код:
for (new i=0;i<=MAX_TAGS;i++)
Looks like Out Of Bounds error. Try this one:

pawn Код:
for (new i; i < MAX_TAGS; i++)
Reply
#4

thx Vince its working now well...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)