[HELP]License plate bug
#1

Hello i have weird problem when i set a license plate to a car in my server.
Everything is good when i set it but when i restart the server my license plate its not that i want.
[ 1 ]
[ 2 ]
When i restart the server ...
[ 3 ]
The command code is:
Код:
CMD:shopplate(playerid, params[])
{
    if(PlayerInfo[playerid][pShopTech])
	{
		new iVehType, iVehIndex, iTargetOwner, carid, orderid, plate[32];
        if(sscanf(params, "dds[32]", carid, orderid, plate))
		{
		    SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /shopplate [carid] [orderid] [plate/remove]");
		    SendClientMessageEx(playerid, COLOR_GREY, "COLORS: (black/white/blue/red/green/purple/yellow/lightblue/navy/beige/darkgreen/darkblue/darkgrey/gold/brown/darkbrown/darkred");
			SendClientMessageEx(playerid, COLOR_GREY, "/maroon/pink) USAGE: (red)Hi(white)how are you? NOTE: Each color counts for 8 characters");
			return 1;
		}

		foreach(Player, i)
		{
			iVehIndex = GetPlayerVehicle(i, carid);
			if(iVehIndex != -1)
			{
				iVehType = 1;
				iTargetOwner = i;
				break;
			}
		}
		if(iVehType == 1)
		{
		    format(plate, sizeof(plate), "%s", str_replace("(black)", "{000000}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(white)", "{FFFFFF}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(blue)", "{0000FF}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(red)", "{FF0000}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(green)", "{008000}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(purple)", "{800080}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(yellow)", "{FFFF00}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(lightblue)", "{ADD8E6}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(navy)", "{000080}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(beige)", "{F5F5DC}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(darkgreen)", "{006400}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(darkblue)", "{00008B}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(darkgrey)", "{A9A9A9}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(gold)", "{FFD700}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(brown)", "{A52A2A}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(darkbrown)", "{5C4033}", plate));
		    format(plate, sizeof(plate), "%s", str_replace("(darkred)", "{8B0000}", plate));

		    new string[128], Float:X, Float:Y, Float:Z;
		    GetVehiclePos(carid, X, Y, Z);
		    if(strcmp(plate, "remove", true) == 0)
		    {
		        PlayerVehicleInfo[iTargetOwner][iVehIndex][pvPlate] = 0;
		    }
		    else
		    {
				format(PlayerVehicleInfo[iTargetOwner][iVehIndex][pvPlate], 32, "%s", plate);
				SetVehicleToRespawn(carid);
				SetVehiclePos(carid, X, Y, Z);
			}
			new query[2048];
			SaveAccountsUpdate();
			format(query, sizeof(query), "%s `pv%dPlate` = '%s';", query, iVehIndex,plate );
			format(string, sizeof(string), "Plate set on %s (ID: %d) %s (ID: %d)", GetPlayerNameEx(iTargetOwner), iTargetOwner, GetVehicleName(carid), carid);
			SendClientMessage(playerid, COLOR_WHITE, string);
			format(string, sizeof(string), "(OrderID: %d) Plate: %s", orderid, plate);
			SendClientMessage(playerid, COLOR_WHITE, string);
			format(string, sizeof(string), "%s set %s %s (Slot %d) plate to %s (order %d)", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetOwner), GetVehicleName(carid), iVehIndex, plate, orderid);
			Log("logs/shoplog.log", string);
		}
		else
		{
		    SendClientMessageEx(playerid, COLOR_GRAD1, "This is not a player owned vehicle, you cannot give it a custom plate.");
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
	}
	return 1;
}
Please help..
Reply


Messages In This Thread
[HELP]License plate bug - by Pr0GreSiVe - 28.01.2014, 15:25
Re: [HELP]License plate bug - by Smileys - 28.01.2014, 15:37
Re: [HELP]License plate bug - by dominik523 - 28.01.2014, 16:36
Re: [HELP]License plate bug - by McBan - 28.01.2014, 16:52
Re: [HELP]License plate bug - by Pr0GreSiVe - 28.01.2014, 23:19

Forum Jump:


Users browsing this thread: 1 Guest(s)