01.10.2010, 18:10
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.)
{
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.)