(HELP) Car Colors don't save - 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: (HELP) Car Colors don't save (
/showthread.php?tid=272221)
(HELP) Car Colors don't save -
spaty2 - 27.07.2011
When i'm going to respray my car, and after respawn/restart that color's doesn't save and there is that color what were normally. Pls know someone how to fix?I need that to save. Thx.
Re: (HELP) Car Colors don't save -
Luis- - 27.07.2011
A code may help..
Re: (HELP) Car Colors don't save -
TouR - 27.07.2011
How we gonna fix it without code? Are we magicians or smthing?
Re: (HELP) Car Colors don't save -
spaty2 - 27.07.2011
I'm givin' codes, but i don't know what code ... because pay'n'spray code i dont have, I can give you just /v color
pawn Код:
else if(strcmp(x_nr,"color",true) == 0)
{
if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999 && PlayerInfo[playerid][pPcarkey3] == 999)
{
SendClientMessage(playerid, COLOR_GREY," You don't have a vehicle to respray.");
return 1;
}
if(GetPlayerMoney(playerid) < 1000)
{
SendClientMessage(playerid, COLOR_GREY," You don't have enough money for vehicle respray.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v color [ColorOneID] [ColorTwoID]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 && color1 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v color [ColorOneID] [ColorTwoID]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 && color2 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
new vehid;
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { vehid = PlayerInfo[playerid][pPcarkey3]; }
else { return 1; }
if(IsPlayerInVehicle(playerid, vehid))
{
CarInfo[vehid][cColorOne] = color1;
CarInfo[vehid][cColorTwo] = color2;
SafeGivePlayerMoney(playerid, -1000);
GameTextForPlayer(playerid, "~w~Bill for a Paint Respray~n~~r~-$1000", 5000, 1);
ChangeVehicleColor(vehid, color1, color2);
OnPropUpdate();
OnPlayerUpdate(playerid);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY," You are not in your vehicle.");
return 1;
}
Re: (HELP) Car Colors don't save -
spaty2 - 27.07.2011
bump
Re: (HELP) Car Colors don't save -
TouR - 27.07.2011
pawn Код:
public OnVehicleRespray(playerid, vehicleid, color1, color2) // put it somewhere in your script, Its gonna save the pay and spray color
{
CarInfo[vehicleid][cColorOne] = color1;
CarInfo[vehicleid][cColorTwo] = color2;
OnPropUpdate();
}
Re: (HELP) Car Colors don't save -
spaty2 - 28.07.2011
THX Works