SA-MP Forums Archive
A little help with cmd - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: A little help with cmd (/showthread.php?tid=353205)



A little help with cmd - Rudyy - 22.06.2012

pawn Код:
COMMAND:setovehcol(playerid, params[])
{
    new orgid,col1,col2;
    if(PlayerData[playerid][AdminLevel] != 5) return 0;
    if(sscanf(params,"iii",orgid,col1,col2)) return SendClientMessage(playerid,Grey,"USAGE: /setovehcol [orgid] [col1] [col2]");
    if(!DoesOrgExist(orgid))return SendClientMessage(playerid,Grey,"That Organization does not exist.");
    format(String,sizeof(String),"UPDATE orgvehs SET Color1 = %d, Color2 = %d WHERE `ID` = %d LIMIT 1",col1,col2,orgid);
    mysql_query(String);
    for(new i=1; i<9; i++)
    {
    ChangeVehicleColor(OrgInfo[orgid][Vehicle][i],col1,col2);
    OrgInfo[orgid][VehColor1] = col1;
    OrgInfo[orgid][VehColor2] = col2;
    }
    format(String,sizeof(String),"You have changed the color of all vehicles, in organization %s | Color1: %i | Color2: %i",OrgInfo[orgid][oName],col1,col2);
    SendClientMessage(playerid,Aqua,String);
    return 1;
}
I have 8 org vehicles and i want 8 of them to be saved. But then only the first one on the table is being save . how do i make all 8 of them in the table being saved? o.O

Table example:



Re: A little help with cmd - Rudyy - 22.06.2012

+rep if you help me :/ , anyone?


Respuesta: A little help with cmd - Chris1337 - 22.06.2012

maybe a loop?


Re: A little help with cmd - Rudyy - 22.06.2012

It wouldn't work :/ It will always keep saving the first table


Re: A little help with cmd - Rudyy - 23.06.2012

help