SA-MP Forums Archive
Change vehicle color in database [not working] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Change vehicle color in database [not working] (/showthread.php?tid=180486)



Change vehicle color in database [not working] - cywil - 01.10.2010

if(SprayColor[playerid][0] != -1)
{
if(IsPlayerNPC(playerid)) return 1;
new keysa, uda, lra;
GetPlayerKeys(playerid, keysa, uda, lra);
if(keysa & KEY_FIRE && GetPlayerWeapon(playerid) == 41 && !IsPlayerInAnyVehicle(playerid))
{
if(SprayTime[playerid] > 29)
{
if(IsPlayerNPC(playerid)) return 1;
new nearveh = GetClosestVehicle(playerid, 5.0);
GameTextForPlayer(playerid,"~n~~g~REPAINTED", 3000,4);
new vehicleid = GetVehicleID(nearveh);
ChangeVehicleColor(nearveh, SprayColor[playerid][0], SprayColor[playerid][1]);
DbVehicles[nearveh][vColor1] = SprayColor[playerid][0];
DbVehicles[nearveh][vColor2] = SprayColor[playerid][1];
SaveVehicle(nearveh);
SprayTime[playerid] = 0;
SprayColor[playerid][0] = -1;
SprayColor[playerid][1] = -1;
}
SprayTime[playerid] += 1;
}
}

But... if I restart server, the car color is previous... Also I have Admin Command to change color and it works... but why not with this spray? Greet. Thanks. (Bad English, I know.. sorry.)