Error in House System [Needing Help]
#1

Hi,

I am currently working on a "House System" but came upon some errors :
Код:
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(248) : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(249) : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(250) : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(251) : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(252) : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(253) : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(254) : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(255) : warning 202: number of arguments does not match definition
Ill show what the lines are :

Код:
CMD:createhouse(playerid,params[])
{
	if(PlayerVar[playerid][AdminLevel] < 3) return SendClientMessage(playerid, COL_RED, NOC);//Check if the player is currently rcon logged in.
	{
		new HousePrice,id = HouseCount;//Creating the house price for the selected value in the command, and the last house id created.
		if(sscanf(params,"i",HousePrice)) return SendClientMessage(playerid, COL_RED, ".:: Error : Usage : /createhouse (Price)");//Checking if the player uses the correct syntax. The parameter "i" in sscanf means integer, also could be used as "d".
		new Float:x,Float:y,Float:z;//Creating the floats, to store the player's position.
		GetPlayerPos(playerid,x,y,z);//Getting the player's position and storing it
		HInfo[id][Price] = HousePrice;//Setting the house price to the selected one.
		HInfo[id][Owned] = 0;//Setting the house id owned = 0
		HInfo[id][XPos] = x;//Storing the XPos value to the player's x.
		HInfo[id][YPos] = y;//Storing the YPos value to the player's y.
		HInfo[id][ZPos] = z;//Storing the ZPos value to the player's z.
		HInfo[id][VirtualWorld] = GetPlayerVirtualWorld(playerid);
		format(HInfo[id][Owner],24,"Nonusablenameforthishouse");//Formating the "Owner" house id value to "Nonusablenameforthishouse".
		SendClientMessage(playerid, COL_WHITE, ".:: House Created! ::.");
		HouseEnter[id] = CreateDynamicCP(x,y,z,1.5,GetPlayerVirtualWorld(playerid));//Creating the checkpoint and storing it in the HouseEnter value.
		HouseExit[id] = CreateDynamicCP(443.9237,509.4609,1001.4195,1.5,GetPlayerVirtualWorld(playerid));//Creating the house exit checkpoint and storing it in the HouseExit value.
		new file[40],labelstring[100];//Creating the "file", and the labelstring var.
		format(file,sizeof(file),"/Houses/%i.ini",id);//Formating the var to the selected house directory.
		INI_Open(file);//Opening the file with SII.
		INI_WriteInt("0", HousePrice);//Writing in the place "Price" the inputted "Price" value.
		INI_WriteInt("Owned",0);//Setting to "Owned" = 0 in the ini file.
		INI_WriteInt("VirtualWorld",GetPlayerVirtualWorld(playerid));//Writing "VirtualWorld" = GetPlayerVirtualWorld(..);
		INI_WriteFloat("XPos",x);//Writing the players pos for the check point position.
		INI_WriteFloat("YPos",y);//Self explanatory.
		INI_WriteFloat("ZPos",z);//Self explanatory.
		INI_WriteString("Owner","Nonusablenameforthishouse ");//Writing a string in "Owned" to "Nonusablenameforthishouse"
		INI_Close();//Closing the file with SII.
		format(labelstring,sizeof(labelstring),"Owned: No \nPrice: %i",HousePrice);
		HInfo[id][HouseLabel] = Create3DTextLabel(labelstring, 0xFF0000FF,x,y,z,25, 0,GetPlayerVirtualWorld(playerid));
		HouseCount++;
	}
	return 1;
}
Could anybody figure this out for me?

Thanks,

Yoran
Reply
#2

Quote:

C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(24 : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(249) : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(250) : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(251) : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(252) : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(253) : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(254) : error 035: argument type mismatch (argument 1)
C:\Users\minec_000\Desktop\MI-RP 0.3x\gamemodes\RP.pwn(255) : warning 202: number of arguments does not match definition

Please mention these lines in the command.
Reply
#3

pawn Код:
INI_Open(file);//Opening the file with SII.
        INI_WriteInt("0", HousePrice);//Writing in the place "Price" the inputted "Price" value.
        INI_WriteInt("Owned",0);//Setting to "Owned" = 0 in the ini file.
        INI_WriteInt("VirtualWorld",GetPlayerVirtualWorld(playerid));//Writing "VirtualWorld" = GetPlayerVirtualWorld(..);
        INI_WriteFloat("XPos",x);//Writing the players pos for the check point position.
        INI_WriteFloat("YPos",y);//Self explanatory.
        INI_WriteFloat("ZPos",z);//Self explanatory.
        INI_WriteString("Owner","Nonusablenameforthishouse ");
Is there a parameter file in the INI_Write Functions??
And file variable are File datatype so you must new File:file; Not sure, the INI System might use anything, for ex, few INI systems have their own datatypes like INI:file
Try these:
1. Change new file to INI:file; if that doesn't work then later try new File:file;
2. Add file as the first parameter in all the INI_* functions.
3. Try this file = INI_Load("file.ini");

pawn Код:
file = INI_Open("abc.txt");//Opening the file with SII.
        INI_WriteInt(file,"0", HousePrice);//Writing in the place "Price" the inputted "Price" value.
        INI_WriteInt(file,"Owned",0);//Setting to "Owned" = 0 in the ini file.
        INI_WriteInt(file,"VirtualWorld",GetPlayerVirtualWorld(playerid));//Writing "VirtualWorld" = GetPlayerVirtualWorld(..);
        INI_WriteFloat(file,"XPos",x);//Writing the players pos for the check point position.
        INI_WriteFloat(file,"YPos",y);//Self explanatory.
        INI_WriteFloat(file,"ZPos",z);//Self explanatory.
        INI_WriteString(file,"Owner","Nonusablenameforthishouse ");
                INI_Close(file);
Reply
#4

.....
Reply
#5

Quote:
Originally Posted by Littlehelper[MDZ]
Посмотреть сообщение
Never used SII sorry,
Maybe this tutorial will help you.
:P :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)