Dialog 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: Dialog help (
/showthread.php?tid=446331)
Dialog help -
sim_sima - 25.06.2013
This might be a silly question, but it is like 2 years since I scripted for SA-MP
I am making a small script for myself, which I am just going to use for some testing...
It is a small and very simple object spawner script.
When player types "/obj" a dialog appears, in whichh you type the object ID of which you want to spawn.
I just have a small issue... the problem is the "inputtext" parameter. My script looks like this:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == 1)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateObject(inputtext, x, y, z, 0.0, 0.0, 0.0, 0.0);
}
return 1;
}
The "inputtext" parameter in the CreateObject is the one causing the error.
Hope someone can help me. Thanks in advance.
Re: Dialog help -
Deathstalker - 25.06.2013
Try this:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == 1)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateObject(strval(inputtext), x, y, z, 0.0, 0.0, 0.0, 0.0);
}
return 1;
}
Re: Dialog help -
sim_sima - 25.06.2013
Quote:
Originally Posted by Deathstalker
Try this:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == 1)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateObject(strval(inputtext), x, y, z, 0.0, 0.0, 0.0, 0.0);
}
return 1;
}
|
Seems to be working
Thank you!
Re: Dialog help -
introzen - 25.06.2013
The input value is a string. Coun't the value of it with strval().