need help with ondialogresponse
#1

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

You didn't defeni the symbol which you're using
Reply
#3

Change "params" to "inputtext".
Reply
#4

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)