A newbie need help
#1

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);
}
Reply
#2

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

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 -
Reply
#4

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.
Reply
#5

Then do it like this:
PHP код:
CMD:minigun(playeridparams[])
{
    
ShowPlayerDialog(playeridDIALOGMINIGUNDIALOG_STYLE_MSGBOX"Minigun""Are you sure you wanna join the minigun dm?""Yes""No");
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == DIALOGMINIGUN)
    {
        if(
response)
        {
            
// Here the code used when player click Yes
        
}
        else 
        {
            
// Here the code used when player click No
        
}
    }
    return 
0;

Reply
#6

Quote:
Originally Posted by oMa37
Посмотреть сообщение
Then do it like this:
PHP код:
CMD:minigun(playeridparams[])
{
    
ShowPlayerDialog(playeridDIALOGMINIGUNDIALOG_STYLE_MSGBOX"Minigun""Are you sure you wanna join the minigun dm?""Yes""No");
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)