SA-MP Forums Archive
Urgent Problem, addhouse (mySQL) Please Help! - 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: Urgent Problem, addhouse (mySQL) Please Help! (/showthread.php?tid=279735)



Urgent Problem, addhouse (mySQL) Please Help! - jesse237 - 28.08.2011

Ok I've been struggling with this for days now...

Somehow this works:

Code:
CMD:add3dlabel(playerid, params[])
{
    if(PVar[playerid][pAdminLevel] >= 5)
	{
	    new
	        LabelText[128],
			Float:X,
			Float:Y,
			Float:Z;
	    if(unformat(params, "s[128]",LabelText)) return SendClientMessage(playerid, COLOR_RED, ""#CRED"USAGE: "#CORANGE"/Add3DLabel < Description >");
		GetPlayerPos(playerid, X, Y, Z);

		AddLabelToFile(LabelText, X, Y, Z);
		CreateDynamic3DTextLabel(LabelText, RColors[random(sizeof(RColors))], X, Y, Z, 100.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100.0);
		format(Msg, sizeof(Msg), "A new 3D Text Label Has Been dynamically added. Description: \"%s\".",LabelText);
		return SendClientMessage(playerid, COLOR_CADETBLUE, Msg);
	}
	else return SendClientMessage(playerid,  COLOR_ORANGE, "You are not an administrator with the required level: 5");
}
And this doesn't:

Code:
CMD:addhouse(playerid, params[])
{
	Loop(i, MAX_HOUSES)
    if(PVar[playerid][pAdminLevel] >= 2)
	{
	    new
	        LabelText[128],
			Float:X,
			Float:Y,
			Float:Z,
			HouseCost,
			pHouseKey,
			OwnerName[24],
			Virtual,
			Interior,
			pHouseID;
			
	    if(unformat(params, "ds[128]",HouseCost, LabelText)) return SendClientMessage(playerid, COLOR_RED, ""#CRED"USAGE: "#CORANGE"/Add3DLabel < Description >");
	    Virtual = GetPlayerVirtualWorld(playerid);
	    Interior = GetPlayerVirtualWorld(playerid);
		GetPlayerPos(playerid, X, Y, Z);
		HouseCPOut[i] = CreateDynamicCP(X, Y, Z, 1.5, Virtual, Interior, -1, 5.0);
        SaveHouses(X, Y, Z, pHouseID, pHouseKey, 0, LabelText);

		format(Msg, sizeof(Msg), "A new house has been added, ID: \"%d\" Cost \"%d\" - Owner: \"'%s'\" - Adress \"'%s'\"",pHouseID, HouseCost, OwnerName, LabelText);
		return SendClientMessage(playerid, COLOR_ORANGE, Msg);
	}
	else return SendClientMessage(playerid,  COLOR_ORANGE, "You are not an administrator with the required level: 5");
}
Giving the error:

Code:
C:\SA-MP servers\The Roleplay Server\gamemodes\RoleplayServer.pwn(1087) : error 035: argument type mismatch (argument 7)
Which is:
Code:
SaveHouses(X, Y, Z, pHouseID, pHouseKey, 0, LabelText);
Basicly those 2 codes are the same, except the one for adding a house (which basicly is only adding a checkpoint yet). But still code 2 gives that error, and I just can't seem to figure out why. Code 1 is almost the same code except that for params you only put in one line of text, there's no multiple things.

EDIT: Kinda solved it with help from house FS of Mitch88 and Watcha.