Skin Dialog Random Skin HELP!!! [REPS++]
#1

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!!!
Reply
#2

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

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

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

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

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

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

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

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

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

-Sorry For Double Post
Reply
#11

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;

Reply
#12

Код:
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
Reply
#13

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.^^
Reply
#14

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!
Reply
#15

So is it fixed?
Reply
#16

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
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)