Random Skins
#8

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
pawn Код:
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_REGISTER)
    {
        if(response)//male response
        {
            //function here
        }
        if(!response)//female response
        {
            //function here
        }
    }
}
Use this.
Could be optimized to this.
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_REGISTER:
        {
            if(response)// male response
            {
                // male code
            }
            // female code here
            return 1;
        }
    }
    return 1;
}
Switch statements are much more efficient than the else-if structure, and you don't need to check for both buttons.

EDIT:

On topic, if you have two arrays. One containing the male skins and vice versa. You would use the random function to select a random skin.

pawn Код:
if(response)// male response
{
    PlayerSkin[playerid] = maleArray[random(sizeof(maleArray))];
}
Reply


Messages In This Thread
Random Skins - by D.Prizzy - 08.06.2012, 22:12
Re: Random Skins - by Kitten - 08.06.2012, 23:49
Re: Random Skins - by D.Prizzy - 08.06.2012, 23:59
Re: Random Skins - by Vince - 09.06.2012, 00:16
Re: Random Skins - by MP2 - 09.06.2012, 00:21
Re: Random Skins - by D.Prizzy - 09.06.2012, 00:34
Re: Random Skins - by JhnzRep - 09.06.2012, 02:44
Re: Random Skins - by ReneG - 09.06.2012, 02:47
Re: Random Skins - by D.Prizzy - 09.06.2012, 14:26
Re: Random Skins - by MadeMan - 09.06.2012, 14:37

Forum Jump:


Users browsing this thread: 1 Guest(s)