SA-MP Forums Archive
need help with ondialogresponse - 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: need help with ondialogresponse (/showthread.php?tid=495913)



need help with ondialogresponse - karolis11234 - 19.02.2014

im trying to make a /me command but instead of a command i would need to write the message in the dialog i tried this:
else if(dialogid == skalbimas)
{
new string[128],name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "[ME]: %s %s", name, params);
SendClientMessageToAll(-1, string);
return 1;
}

but i get a error at line 541

D:\GAMES\GTASA\SAMP\gamemodes\darbas.pwn(541) : error 017: undefined symbol "params"

can anybody help me ?


Re: need help with ondialogresponse - Clad - 19.02.2014

You didn't defeni the symbol which you're using


Re: need help with ondialogresponse - Konstantinos - 19.02.2014

Change "params" to "inputtext".


Re: need help with ondialogresponse - karolis11234 - 19.02.2014

thanks konstantinos it works but how do i make it to dont display a message when i dont type in anything ?


Re: need help with ondialogresponse - Konstantinos - 19.02.2014

strlen returns the string's lenght so if it's 0, return 1.

pawn Код:
else if(dialogid == skalbimas)
{
    if(!strlen(inputtext)) return 1;
    new string[128],name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(string, sizeof(string), "[ME]: %s %s", name, params);
    SendClientMessageToAll(-1, string);
    return 1;
}