help! - 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: help! (
/showthread.php?tid=225378)
help! -
omer5198 - 13.02.2011
how can i use the input? i mean... can you give me an exemple? i know how to do with
switch(listitem) but how can i do that when he right something it do something? thx!
Re: help! -
HyperZ - 13.02.2011
Dialog input?
Re: help! -
omer5198 - 13.02.2011
Quote:
Originally Posted by Clive
Dialog input?
|
yea
Re: help! -
Medal Of Honor team - 13.02.2011
Next time search in wiki
pawn Код:
if(!strcmp(cmdtext, "/chat", true))
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Chat", "Type your chat input here.", "Submit", "Cancel");
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// Checking if they pressed the first button, if so continue:
{
switch(dialogid)//if your using only one dialog this isn't needed but you never know.
{
case 1:// Our dialog
{
switch(listitem)// Checking which listitem was chosen
{
case 0: // The first item in the list
{
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -1);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK);
}
case 1: // The second item in the list
{
if(GetPlayerMoney(playerid) < 2) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -2);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
}
case 2: // The third item in the list
{
if(GetPlayerMoney(playerid) < 3) return SendClientMessage(playerid, 0xFFFFFF, "You don't have enough cash.");
GivePlayerMoney(playerid, -3);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE);
}
}
}
case 2:// The new dialog
{
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1,1,1,1,1,10);// This will let you "relax" for 10 seconds.
}
// Here we add new things...
case 3:
{
if(strlen(inputtext) > 0)
{
SendPlayerMessageToAll(playerid, inputtext);
}
else
{
SendClientMessage(playerid,0xFFFFFFAA,"Your input was too short.");
}
}
// Until here.
}
}
return 1;
}
Re: help! -
HyperZ - 13.02.2011
I've created a /changeskin command with dialig input i hope it helpz
http://pawn.pastebin.com/HtYVymzf
Re: help! -
omer5198 - 13.02.2011
thx but i want to add money with the iput text so how can i do it?
PlayerInfo[playerid][BankMoney] + inputtext?