SA-MP Forums Archive
Skin Dialog Random Skin HELP!!! [REPS++] - 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: Skin Dialog Random Skin HELP!!! [REPS++] (/showthread.php?tid=571343)



Skin Dialog Random Skin HELP!!! [REPS++] - Chausar - 18.04.2015

I want if player entered the server they are forced to select the genre from Dialog_Style_List

Code:
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "What is your genre?", "Male\nFemale", "Select", "Quit");
after this player chosed "Male" i want that player spawned with random skin male..

can somebody do some code for me? please! I will reps!!!


Re: Skin Dialog Random Skin HELP!!! [REPS++] - ChuckyBabe - 18.04.2015

You must rename yung dialog id to "s1" or any letter you want.

define it,
#define s1 12328
then dialogid == s1

Setplayerskin(playerid, skinid);

I almost did it but you must do it by yourself.


Re: Skin Dialog Random Skin HELP!!! [REPS++] - Chausar - 18.04.2015

Quote:
Originally Posted by ChuckyBabe
View Post
You must rename yung dialog id to "s1" or any letter you want.

define it,
#define s1 12328
then dialogid == s1

Setplayerskin(playerid, skinid);

I almost did it but you must do it by yourself.
please help me.. i totally noob for this!


Re: Skin Dialog Random Skin HELP!!! [REPS++] - Gammix - 18.04.2015

Do you want to disable player class selection?

If yes, use this include: http://forum.sa-mp.com/showthread.ph...35#post3434035
Read there(in NOTES section) how to disable class selection.

If you want the player to go to a spectate screen, Read the callback OnPlayerEnterClassSelection(in NOTES section).

Here is an example:
pawn Code:
#include <a_samp>
#include <classcontrol>

public OnPlayerEnterClassSelection(playerid)
{
    //Now show your dialogs here:
    ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Select Genre", "your list", "Select", "");
   
    return 0;//returning 0, the player will go to spectate screen
}

public OnPlayerExitClassSelection(playerid)
{
    return 1;
}

public OnPlayerSwitchClass(playerid, classid, bool:next)
{
    return 1;
}

public OnPlayerSpawnClass(playerid, classid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 0)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    //your code, the player selected the 1st listitem
                }//and so one...
            }
        }
    }
    return 1;
}
Read the comments in the script^; What this do is, when a player enters Class selection, he is directed to a spectate screen and is shown a dialog to choose genre.
Configure the dialog and its response in callback: OnDialogResponse yourself. If you want the player to come back from spectate screen, use TogglePlayerSpectating(playerid, false);


Re: Skin Dialog Random Skin HELP!!! [REPS++] - Chausar - 18.04.2015

Quote:

Gammix;3434041]Do you want to disable player class selection?

I'm already disable player class selection.. i want to do if player enter the server..they are forced to select their genre.. after select the genre Male for example, they got random male skin and spawn at my setted coordinated.. can you make some script for me?


Re: Skin Dialog Random Skin HELP!!! [REPS++] - Gammix - 18.04.2015

Quote:
Originally Posted by Chausar
View Post
I'm already disable player class selection.. i want to do if player enter the server..they are forced to select their genre.. after select the genre Male for example, they got random male skin and spawn at my setted coordinated.. can you make some script for me?
Thats exactly what my example did.


Re: Skin Dialog Random Skin HELP!!! [REPS++] - Chausar - 18.04.2015

Quote:
Originally Posted by Gammix
View Post
Thats exactly what my example did.
Do i need to use that include?


Re: Skin Dialog Random Skin HELP!!! [REPS++] - Gammix - 18.04.2015

Yes, thats why i mentioned it. All those callbacks and functions are not default samp's functions.


Re: Skin Dialog Random Skin HELP!!! [REPS++] - Chausar - 18.04.2015

Quote:
Originally Posted by Gammix
View Post
Yes, thats why i mentioned it. All those callbacks and functions are not default samp's functions.
Is this corrected? If not please fix this...


Code:
public OnPlayerEnterClassSelection(playerid)
{
	//Now show your dialogs here:
	ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Select Genre", "Just Give me random!", "OK", "");

	return 0;//returning 0, the player will go to spectate screen
}
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == 0)
	{
	    if(response)
	    {
	        switch(listitem)
	        {
	            case 0:
	            {
	                SetPlayerSkin(playerid, 1);//The Truth Skin
	            }
	        }
	    }
	}
	return 1;
}
After clicked "OK" nothing happened.. how to make player spawned with that skin?


Re: Skin Dialog Random Skin HELP!!! [REPS++] - Chausar - 18.04.2015

I'm added
Code:
SpawnPlayer(playerid);
After clicked "OK" i spawned at the sky like a ball skin

-Sorry For Double Post


Re: Skin Dialog Random Skin HELP!!! [REPS++] - ATGOggy - 18.04.2015

Try this:
PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    
ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"What is your genre?""Male\nFemale""Select""Quit");
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid==1)
    {
         if(!
response) return ShowPlayerDialog(playerid1DIALOG_STYLE_LIST"What is your genre?""Male\nFemale""Select""Quit");
         if(
listitem==0)
         {
              new 
bool:Success;
              while(!
Success)
              {
                   new 
skin=random(300);
                   if(
skin<|| (skin>13 && skin<39 && skin!=31) || (skin>41 && skin<53) || (skin>56 && skin<63) || (skin>65 skin<75 && skin!=69) || (skin>77 && skin<87 && skin!=85)
                   || (
skin>93 && skin<129) || (skin>131 && skin<138) || (skin>141 && skin<150 && skin!=145 skin!=148) || (skin>152 && skin<190 && skin!=157 && skin!=169 && skin!=172 && skin!=178) || skin==200 || (skin>201 && skin<214 skin!=205 && skin!=207 && skin!=211)
                   || 
skin==217 || (skin>219 skin<224) || (skin>226 && skin<231) || (skin>233 skin<237) || (skin>238 && skin<243) || (skin>246 && skin<256 && skin!=251) || (skin>257 && skin!=263 && skin!=298)) Success=true;
                   if(
Success)
                   {
                       
SpawnPlayer(playerid);
                       
SetPlayerSkin(playeridskin);
                   }
              }
         }
         if(
listitem==1)
         {
              new 
bool:Success=true;
              while(!
Success)
              {
                   new 
skin=random(300);
                   if(
skin<|| (skin>13 && skin<39 && skin!=31) || (skin>41 && skin<53) || (skin>56 && skin<63) || (skin>65 skin<75 && skin!=69) || (skin>77 && skin<87 && skin!=85)
                   || (
skin>93 && skin<129) || (skin>131 && skin<138) || (skin>141 && skin<150 && skin!=145 skin!=148) || (skin>152 && skin<190 && skin!=157 && skin!=169 && skin!=172 && skin!=178) || skin==200 || (skin>201 && skin<214 skin!=205 && skin!=207 && skin!=211)
                   || 
skin==217 || (skin>219 skin<224) || (skin>226 && skin<231) || (skin>233 skin<237) || (skin>238 && skin<243) || (skin>246 && skin<256 && skin!=251) || (skin>257 && skin!=263 && skin!=298)) Success=false;
                   if(
Success)
                   {
                       
SpawnPlayer(playerid);
                       
SetPlayerSkin(playeridskin);
                   }
              }
         }
    }
    return 
1;




Re: Skin Dialog Random Skin HELP!!! [REPS++] - Chausar - 18.04.2015

Код:
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(400) : error 001: expected token: "-identifier-", but found "-integer value-"
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(401) : warning 212: possibly unintended bitwise operation
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : error 001: expected token: ")", but found "-integer value-"
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : error 029: invalid expression, assumed zero
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : warning 213: tag mismatch
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 212: possibly unintended bitwise operation
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 212: possibly unintended bitwise operation
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 215: expression has no effect
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(403) : error 001: expected token: ";", but found ")"
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(403) : fatal error 107: too many error messages on one line



Re: Skin Dialog Random Skin HELP!!! [REPS++] - Gammix - 18.04.2015

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 0)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    SetPlayerSkin(playerid, 1);//The Truth Skin
                    TogglePlayerSpectating(playerid, false);
                    return SpawnPlayer(playerid);
                }
            }
        }
    }
    return 1;
}
You did all right but forgot to reset player spectate mod and spawn.^^


Re: Skin Dialog Random Skin HELP!!! [REPS++] - Chausar - 18.04.2015

Quote:
Originally Posted by Gammix
Посмотреть сообщение
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 0)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    SetPlayerSkin(playerid, 1);//The Truth Skin
                    TogglePlayerSpectating(playerid, false);
                    return SpawnPlayer(playerid);
                }
            }
        }
    }
    return 1;
}
You did all right but forgot to reset player spectate mod and spawn.^^
Spawned as CJ at Blueberry... My problem was such a brick!


Re: Skin Dialog Random Skin HELP!!! [REPS++] - ATGOggy - 18.04.2015

So is it fixed?


Re: Skin Dialog Random Skin HELP!!! [REPS++] - Chausar - 18.04.2015

Quote:
Originally Posted by ATGOggy
Посмотреть сообщение
So is it fixed?
I got lots of error. you didn't test the code?

Код:
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(400) : error 001: expected token: "-identifier-", but found "-integer value-"
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(401) : warning 212: possibly unintended bitwise operation
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : error 001: expected token: ")", but found "-integer value-"
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : error 029: invalid expression, assumed zero
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402) : warning 213: tag mismatch
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 212: possibly unintended bitwise operation
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 212: possibly unintended bitwise operation
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(402 -- 403) : warning 215: expression has no effect
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(403) : error 001: expected token: ";", but found ")"
D:\Barang2\sa-mp\Khausar Server SA-MP\gamemodes\khausargamemode.pwn(403) : fatal error 107: too many error messages on one line