[HELP!!] argument type mismatch (argument 2)
#1

Код:
if(dialogid == 2626262626)
	{
		if(!response) return 1;
		if(strlen(inputtext))
		{
			new xObjFormat[128];
	                new Float:X, Float:Y, Float:Z;
			GetPlayerPos(playerid, X, Y, Z);
			format(xObjFormat,sizeof(xObjFormat),"%s",inputtext);
			new xXObject;
		 	xXObject = CreateObject(xObjFormat, X, Y, Z, 0.0, 0.0, 0.0);
			EditObject(playerid, xXObject);
    	}
		return 1;
	}
The Warning
C:\Users\Bar\Desktop\KakiGadol\gamemodes\RoshBeich a.pwn(13046) : error 035: argument type mismatch (argument 1)

Line 13046:
Код:
xXObject = CreateObject(xObjFormat, X, Y, Z, 0.0, 0.0, 0.0);
Reply
#2

The first parameter of CreateObject isn't a string, it's a integer (the model ID of the object).
Reply
#3

Quote:
Originally Posted by Nimrod
Посмотреть сообщение
The first parameter of CreateObject isn't a string, it's a integer (the model ID of the object).
Soo, how fix this?
Reply
#4

Quote:
Originally Posted by Ejecter
Посмотреть сообщение
Soo, how fix this?
Код:
CreateObject(strval(inputtext), X, Y, Z, 0.0, 0.0, 0.0);
You convert the inputtext to an integer.
Reply
#5

String to integer -> strval

https://sampwiki.blast.hk/wiki/Strval
Reply
#6

You also need to confirm your input is valid as well.

new model = strval(inputtext);

Then verify it is a valid model

https://sampforum.blast.hk/showthread.php?tid=323397

if(IsValidModel(model))
{

}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)