SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 18/04/2015, 03:01 AM   #1
Chausar
Big Clucker
 
Chausar's Avatar
 
Join Date: Mar 2015
Posts: 80
Reputation: 1
Thumbs up Skin Dialog Random Skin HELP!!! [REPS++]

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!!!
__________________
Talk is silver, But. silent is gold!
Chausar is offline   Reply With Quote
Old 18/04/2015, 03:09 AM   #2
ChuckyBabe
Huge Clucker
 
ChuckyBabe's Avatar
 
Join Date: Aug 2013
Location: C:\Program Files\Rockstar Games\GTA San Andreas
Posts: 461
Reputation: 11
Default Re: Skin Dialog Random Skin HELP!!! [REPS++]

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.
__________________
ChuckyBabe is offline   Reply With Quote
Old 18/04/2015, 03:14 AM   #3
Chausar
Big Clucker
 
Chausar's Avatar
 
Join Date: Mar 2015
Posts: 80
Reputation: 1
Default Re: Skin Dialog Random Skin HELP!!! [REPS++]

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!
__________________
Talk is silver, But. silent is gold!
Chausar is offline   Reply With Quote
Old 18/04/2015, 05:23 AM   #4
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,766
Reputation: 840
Default Re: Skin Dialog Random Skin HELP!!! [REPS++]

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);
__________________

Follow me on Github: Follow me on Spotify: Donate on Paypal:

Gammix is offline   Reply With Quote
Old 18/04/2015, 05:55 AM   #5
Chausar
Big Clucker
 
Chausar's Avatar
 
Join Date: Mar 2015
Posts: 80
Reputation: 1
Thumbs up Re: Skin Dialog Random Skin HELP!!! [REPS++]

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?
__________________
Talk is silver, But. silent is gold!
Chausar is offline   Reply With Quote
Old 18/04/2015, 06:13 AM   #6
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,766
Reputation: 840
Default Re: Skin Dialog Random Skin HELP!!! [REPS++]

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.
__________________

Follow me on Github: Follow me on Spotify: Donate on Paypal:

Gammix is offline   Reply With Quote
Old 18/04/2015, 06:15 AM   #7
Chausar
Big Clucker
 
Chausar's Avatar
 
Join Date: Mar 2015
Posts: 80
Reputation: 1
Default Re: Skin Dialog Random Skin HELP!!! [REPS++]

Quote:
Originally Posted by Gammix View Post
Thats exactly what my example did.
Do i need to use that include?
__________________
Talk is silver, But. silent is gold!
Chausar is offline   Reply With Quote
Old 18/04/2015, 06:23 AM   #8
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,766
Reputation: 840
Default Re: Skin Dialog Random Skin HELP!!! [REPS++]

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

Follow me on Github: Follow me on Spotify: Donate on Paypal:

Gammix is offline   Reply With Quote
Old 18/04/2015, 06:51 AM   #9
Chausar
Big Clucker
 
Chausar's Avatar
 
Join Date: Mar 2015
Posts: 80
Reputation: 1
Default Re: Skin Dialog Random Skin HELP!!! [REPS++]

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?
__________________
Talk is silver, But. silent is gold!
Chausar is offline   Reply With Quote
Old 18/04/2015, 06:56 AM   #10
Chausar
Big Clucker
 
Chausar's Avatar
 
Join Date: Mar 2015
Posts: 80
Reputation: 1
Default Re: Skin Dialog Random Skin HELP!!! [REPS++]

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

-Sorry For Double Post
__________________
Talk is silver, But. silent is gold!
Chausar is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP] Random skin Fredden1993 Scripting Help 2 03/03/2012 02:46 PM
[HELP]Random skin? Manteiga01 Help Archive 3 22/12/2010 04:35 PM
Random Skin x-file Help Archive 3 07/11/2010 01:39 PM
Random skin FreeSoul Help Archive 1 13/05/2009 06:22 PM


All times are GMT. The time now is 05:25 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.