Script rewrite.
#1

How can rewrite this script, because some times not working.
pawn Код:
stock Masinos(playerid)
{
    pInfo[playerid][tr]=-1;
    pInfo[playerid][tr2]=-1;
    pInfo[playerid][tr3]=-1;
    Savininkas(playerid);
    Savininkas2(playerid);
    Savininkas3(playerid);
    return 1;
}

stock Savininkas(playerid)
{

    for(new nvehicle=0; nvehicle<MAX_TRANS; nvehicle++)
    {
        if(CarInfo[nvehicle][pSQLid] == pInfo[playerid][sQLID])
        {
            pInfo[playerid][tr] = nvehicle;
        }
    }
return 1;
}

stock Savininkas2(playerid)
{
    for(new nvehicle=0; nvehicle<MAX_TRANS; nvehicle++)
    {
        if(pInfo[playerid][tr] != nvehicle)
        {
        if(CarInfo[nvehicle][pSQLid] == pInfo[playerid][sQLID])
        {
            pInfo[playerid][tr2] = nvehicle;
        }
    }
}
return 1;
}

stock Savininkas3(playerid)
{
    for(new nvehicle=0; nvehicle<MAX_TRANS; nvehicle++)
    {
        if( pInfo[playerid][tr] != nvehicle && pInfo[playerid][tr2] != nvehicle && pInfo[playerid][treciasTR] == true && pInfo[playerid][tr3] == -1)
        {
        if(CarInfo[nvehicle][pSQLid] == pInfo[playerid][sQLID])
        {
            pInfo[playerid][tr3] = nvehicle;
        }
    }
}
return 1;
}
Reply
#2

Help.
Reply
#3

pawn Код:
stock Masinos(playerid)
{
    pInfo[playerid][tr]=-1;
    pInfo[playerid][tr2]=-1;
    pInfo[playerid][tr3]=-1;
    Savininkas(playerid);
    Savininkas2(playerid);
    Savininkas3(playerid);
    return 1;
}

stock Savininkas(playerid)
{

    for(new nvehicle=0; nvehicle<MAX_TRANS; nvehicle++)
    {
        if(CarInfo[nvehicle][pSQLid] == pInfo[playerid][sQLID])
        {
            pInfo[playerid][tr] = nvehicle;
        }
    }
return 1;
}

stock Savininkas2(playerid)
{
    for(new nvehicle=0; nvehicle<MAX_TRANS; nvehicle++)
    {
        if(pInfo[playerid][tr] != nvehicle)
        {
        if(CarInfo[nvehicle][pSQLid] == pInfo[playerid][sQLID])
        {
            pInfo[playerid][tr2] = nvehicle;
        }
        }
    }
}
return 1;
}

stock Savininkas3(playerid)
{
    for(new nvehicle=0; nvehicle<MAX_TRANS; nvehicle++)
    {
        if( pInfo[playerid][tr] != nvehicle && pInfo[playerid][tr2] != nvehicle && pInfo[playerid][treciasTR] == true && pInfo[playerid][tr3] == -1)
        {
        if(CarInfo[nvehicle][pSQLid] == pInfo[playerid][sQLID])
        {
            pInfo[playerid][tr3] = nvehicle;
        }
        }
    }
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)