Doesn't save car color
#1

Код:
CMD:scolor(playerid, params[])
{
		new color;
		new color2;
		new tmp1[64];
		new tmp8[64];
		new playername[64];
		new string[100];
		new slot = dini_Int(AddDirFile(dir_carfiles, tmp1), "Slot");
		if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
		{
		    if(sscanf(params,"ii",color,color2)) return SendClientMessage(playerid, -1, "Usage: /scolor [color1] [color2]");

            ChangeVehicleColor(PlayerInfos[playerid][Car][slot], dini_Int(AddDirFile(dir_carfiles, tmp1), "Color"), color,color2);
			ChangeVehicleColor(GetPlayerVehicleID(playerid), color,color2);
            format(string, sizeof(string), "You have successfully changed your car color with %d and %d color ids",color,color2);
			SendClientMessage(playerid,COLOR_WHITE, string);

		}
		else return SendClientMessage(playerid,-1,"ERROR: You must be in a vehicle.");
	    return 1;
}
I guess im using the wrong way to save. Can someone help me out here?
Reply
#2

You don't need to define everything on a different line, do it like this...

PHP код:
new colorcolor2tmp1[64] ... etc
I'm not familiar with d_ini, however it's outdated - upgrade to MySQL which is more efficient.
Reply
#3

Well that's not a fix for my problem. I have been thinking about shifting to MySQL but that's a hell lot of work.
Currently i need someone who could tell me what problem do i have in my code.
Reply
#4

The problem in your code is that you are using dini
Reply
#5

Seriously? DINI is able to save data in cfg files im pretty sure of that. Isn't there somebody who could tell me what's the real problem here?
Reply
#6

I doubt there'll be too many people who can, it's barely used anymore and those of us who came late to the SA-MP party have never used it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)