22.06.2012, 14:22
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;
}
Table example: