strlen text? - 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: strlen text? (
/showthread.php?tid=382298)
strlen text? -
RLGaming - 02.10.2012
I have this CMD:
Quote:
CMD:editgroups(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_WHITE, "You are not authorised to use this command!");
{
ShowPlayerDialog(playerid,6119,DIALOG_STYLE_LIST," Edit Groups:", "Faction Name\nFaction ID", "Select", "Ok");
}
return 1;
}
|
How can I convert it so when they click 'Faction Name' it will come up with a message box and you can insert a name via dialog and then it will read it and like pickup the amount of characters(above 2 under 32)?
+rep, I cannot do this whatsoever :/
I have no idea how I can create this, I have been told I need to use strlen text but I have no idea how
Re : strlen text? -
lelemaster - 02.10.2012
Should be something like this, change the code so it fits your script. P.S. It's been a long time I haven't script, code could have errors.
pawn Код:
case 6119:
{
if(response)
{
if(listitem == 0) //For the listed item 0, so Faction name
{
ShowPlayerDialog(playerid,New_Dialog_ID,DIALOG_STYLE_INPUT," Edit Groups:", "Enter faction name:", "Select", "Ok");
}
}
}
case New_Dialog_ID:
{
if(response)
{
if(strlen(inputtext) >= 2 && strlen(inputtext) <= 32)
{
new string[128];
//Here add the variable of the Faction name, here is an example
//FactionName[PlayerInfo[playerid][pFaction]] = inputtext;
format(string,sizeof(string),"You've changed the faction name to %s.", inputtext);
SendClientMessage(playerid, -1, string);
}
else return ShowPlayerDialog(playerid,New_Dialog_ID,DIALOG_STYLE_INPUT," Edit Groups:", "Enter faction name:", "Select", "Ok");
}
}
Edit: I could be not answering back, I just had a little trip to script again. I'm not always on the forum.