A newbie need 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)
+--- Thread: A newbie need help (
/showthread.php?tid=606639)
A newbie need help -
Eymeric69 - 07.05.2016
Hi everybody i need help, i don't know how to use string and i don't know how to use it, i have watched that :
https://sampwiki.blast.hk/wiki/Format and that :
https://sampwiki.blast.hk/wiki/Control_Structures
but i doesn't understand there is my code(zcmd used) :
Код:
COMMAND:minigundm(playerid, params[])
{
new yes[1], no[2];
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Are you sure?", "Are you sure you want to go to the minigun dm?", "yes", "no", yes, no);
}
Re: A newbie need help -
oMa37 - 07.05.2016
Why you would use string in the ShowPlayerDialog?
This is wrong way to use it, Explain exactly what you want to do with this code?
Re: A newbie need help -
ZToPMaN - 07.05.2016
You must read this
https://sampwiki.blast.hk/wiki/ShowPlayerDialog
This will show you how to make a dialog with the right format.
pawn Код:
CMD:minigundm(playerid,params[])
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_MSGBOX, "Are you sure?", "Are you sure you want to go to the minigun dm?", "yes", "no");
return 1;
}
EDITED -
Re: A newbie need help -
Eymeric69 - 07.05.2016
Quote:
Originally Posted by oMa37
Why you would use string in the ShowPlayerDialog?
This is wrong way to use it, Explain exactly what you want to do with this code?
|
I want do with this code, when the player click on yes he is teleported with weapons and in a special location , and when he say no there is nothing.
Re: A newbie need help -
oMa37 - 07.05.2016
Then do it like this:
PHP код:
CMD:minigun(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOGMINIGUN, DIALOG_STYLE_MSGBOX, "Minigun", "Are you sure you wanna join the minigun dm?", "Yes", "No");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOGMINIGUN)
{
if(response)
{
// Here the code used when player click Yes
}
else
{
// Here the code used when player click No
}
}
return 0;
}
Re: A newbie need help -
Eymeric69 - 07.05.2016
Quote:
Originally Posted by oMa37
Then do it like this:
PHP код:
CMD:minigun(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOGMINIGUN, DIALOG_STYLE_MSGBOX, "Minigun", "Are you sure you wanna join the minigun dm?", "Yes", "No");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOGMINIGUN)
{
if(response)
{
// Here the code used when player click Yes
}
else
{
// Here the code used when player click No
}
}
return 0;
}
|
Thank you i have see that :
https://sampwiki.blast.hk/wiki/OnDialogResponse.