Skin changeCommand works but doesnt change skin
#4

Quote:
Originally Posted by Stinged
View Post
https://sampforum.blast.hk/showthread.php?tid=91354

zcmd is a command processor, it's supposed to 2 arguments, which are playerid and params.

What you're doing is showing the player the dialog, and doing what the dialog should do, all inside the command.
You're supposed to code what dialogs do under OnDialogResponse.
Thanks man i know that i forget something

Quote:
Originally Posted by Meller
View Post
Here:
PHP Code:
CMD:skin(playeridlistitemresponsedialogidinputtext[]) 

    
ShowPlayerDialog(playerid1DIALOG_STYLE_INPUT"Skin Change""Enter the skin id you wish to have below""Confirm""Cancel"); 
    if (
dialogid == 1
    { 
        if(
response
        { 
            new 
skinidmessage[64]; 
            
skinid strval(inputtext); 
            if(
skinid || skinid 299
            { 
                
SendClientMessage(playerid0xFFFFFFFF"SERVER: Skin id may be between 0 and 299."); 
            } 
            else 
            { 
                
SetPlayerSkin(playeridskinid); 
                
format(messagesizeof(message), "SERVER: You have changed your skin id to %d."skinid); 
                
SendClientMessage(playerid0xFFFFFFFFmessage); 
            } 
        } 
    } 
    return 
1

You can't return before it's finished, and you used return twice, removed the first return. Now should it be reachable.

Edit:

PHP Code:
CMD:skin(playerid

    
ShowPlayerDialog(playerid1DIALOG_STYLE_INPUT"Skin Change""Enter the skin id you wish to have below""Confirm""Cancel"); 
    return 
1
}  
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 1
    { 
        if(
response
        { 
            new 
skinidmessage[64]; 
            
skinid strval(inputtext); 
            if(
skinid || skinid 299
            { 
                
SendClientMessage(playerid0xFFFFFFFF"SERVER: Skin id may be between 0 and 299."); 
            } 
            else 
            { 
                
SetPlayerSkin(playeridskinid); 
                
format(messagesizeof(message), "SERVER: You have changed your skin id to %d."skinid); 
                
SendClientMessage(playerid0xFFFFFFFFmessage); 
            } 
        } 
    }

Read the reply above me.
Thanks m8, im gonna be sure to use it next time. im using Dialog atm then gonna update it to Textdraw
Reply


Messages In This Thread
Skin changeCommand works but doesnt change skin - by SkillNasr - 27.06.2016, 19:01
Re: Skin changeCommand works but doesnt change skin - by Stinged - 27.06.2016, 19:04
Re: Skin changeCommand works but doesnt change skin - by Luicy. - 27.06.2016, 19:04
Re: Skin changeCommand works but doesnt change skin - by SkillNasr - 27.06.2016, 19:14
Re: Skin changeCommand works but doesnt change skin - by SkillNasr - 27.06.2016, 19:16

Forum Jump:


Users browsing this thread: 1 Guest(s)