SA-MP Forums Archive
Is it possible to do this? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Is it possible to do this? (/showthread.php?tid=154736)



Is it possible to do this? - NewTorran - 15.06.2010

Hello,

Ok so on a website, Like say if there was a search bar.

It would be a box. But in it it would say something like: Type in here what yu want to search for

Is it possible to do that with input dialogs? Like put some text in that the player takes out and replaces with whatever?


Re: Is it possible to do this? - Babul - 15.06.2010

if you mean something like "quickstrings", then: yes.
this example cuts out a "#mon", and replaces it with your actual amount of cash
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
	new string1[128],string2[128],result[128];
	new found;
	found=strfind(cmdtext[0],"#mon",true);
	if(found>-1)
	{
		strmid(string1,cmdtext,0,found);
		strmid(string2,cmdtext,found+4,128);
		format(result,sizeof(result),"%s%d%s",string1,GetPlayerMoney(playerid),string2);
		SetPlayerChatBubble(playerid,result,CHAT_CIV_COLOR[GetPVarInt(playerid,"WantedLevel")],100.0,10000);
		SendClientMessageToAll(CHAT_CIV_COLOR[GetPVarInt(playerid,"WantedLevel")],result);
	}
//......
iam too lazy to cut out the not-needed parts atm ^^


Re: Is it possible to do this? - NewTorran - 15.06.2010

No not that.

If i made a input dialog.

Lets say. I put in: Hello im joe
Is it possible to make it put that in a certain dialog without typing anything


Re: Is it possible to do this? - Babul - 15.06.2010

ah you mean a "default" string. like when you /deposit, then a dialog with f.ex "10000" already typed in would pop up...
iam searching for a solution for this too.
imo this could be included in next samp version. we all could take usage of this :P
edit: this feature would make sending (saved) messages easy aswell. like a predefined string "Babul is selling max prized weps @ $loc", so that string set as default after typing /pm <id> would speed up gameplay a lot