SA-MP Forums Archive
Not saving - 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: Not saving (/showthread.php?tid=596767)



Not saving - AndreiWow - 22.12.2015

Why is this not saving?
Код:
public OnPlayerSpray(playerid)
{
    if(pick == 1)
	{
	    //new color = colort;
    	ChangeVehicleColor(vehid, colort, 0);
    	VehicleColor[playerid][0] = colort;
	}
	else
	{
	    new pID;
	    //new color2=color;
	    pID = Requested[playerid];
		ChangeVehicleColor(vehid, 0, colort);
		VehicleColor[playerid][1] = colort;
		KillTimer(SprayT);
		//Spray[pID] = 0;
		//Spray[playerid] = 0;
		Service[pID][0] = 0;
		Service[playerid][0] = 0;
		SaveVehicle(playerid);
		SendClientMessage(playerid, COLOR_GREEN, "Ai vopsit masina cu succes!");
	}
	return 1;
}



Re: Not saving - Sh4d0w2 - 22.12.2015

What you mean by saving?
What it should save?


Re: Not saving - AndreiWow - 22.12.2015

VehicleColor[playerid][0] = colort;
VehicleColor[playerid][1] = colort;

If I /v park the vehicle and spawn it back the colors will reset

but this one is saving

Код:
case DIALOG_COLOR1:
  		{
  		    if(GetPlayerMoney(playerid) < 99) return SCM(playerid, COLOR_LIGHTRED, "You do not have enough money.");
       		new vehicleid;
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
				vehicleid = GetPlayerVehicleID(playerid);
			}
			new id = GetVehicleID(vehicleid);

 			new color = strval(inputtext);
	        if(color < 0 || color > 255) return ShowPlayerDialog(playerid, DIALOG_COLOR1, DIALOG_STYLE_INPUT,"Color","Please type in colour id 1 below. [0-255]","Submit","Cancel");
	        VehicleColor[id][0] = color;
	        ShowPlayerDialog(playerid, DIALOG_COLOR2, DIALOG_STYLE_INPUT,"Color","Please type in colour id 2 below.","Submit","Cancel");
		}
		case DIALOG_COLOR2:
  		{
  			new vehicleid;
			if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
			{
				vehicleid = GetPlayerVehicleID(playerid);
			}
			new id = GetVehicleID(vehicleid);

 			new color2 = strval(inputtext);
	        if(color2 < 0 || color2 > 255) return ShowPlayerDialog(playerid, DIALOG_COLOR2 , DIALOG_STYLE_INPUT, "Color","Please type in colour id 2 below. [0-255]","Submit","Cancel");
	        VehicleColor[id][1] = color2;

	        ChangeVehicleColor(vehicleid, VehicleColor[id][0], VehicleColor[id][1]);
			GivePlayerMoney(playerid, -100);
			SaveVehicle(id);
		}