Dialog help
#1

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.
Reply
#2

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;
}
Reply
#3

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!
Reply
#4

The input value is a string. Coun't the value of it with strval().
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)