SA-MP Forums Archive
[HELP]Needs Help With Classes In Dialog - 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: [HELP]Needs Help With Classes In Dialog (/showthread.php?tid=405087)



[HELP]Needs Help With Classes In Dialog - KomplettMaster - 05.01.2013

Hey
Can Someone Help Me With Class Selection In Dialogs?
I Want Text In That Class Selection :
[CLASS]Trucker
[CLASS]Pilot
[CLASS]Police
[CLASS]Farmer
And I Want A Dialog That Classes Can Choose Where They Want To Spawn.
I Have Login System And Admin System And...
Want Random Skin For Trucker Skins I Choosed. (FOR ALL CLASSES)
And Random Spawns To Classes (SPAWNS I ADD)
Can Someone Make It?
The i Be Verry Happy


Re: [HELP]Needs Help With Classes In Dialog - arakuta - 05.01.2013

You must put the texts at the public OnPlayerRequestClass...

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    switch(classid) // Instead of use a lot of conditions, we go directly to the classid condition
    {
        case 0: GameTextForPlayer(playerid,"This Is An ~r~Red Exemple!",3000,2); // show this text is classid is 0, (First AddPlayerClass)
        case 1: GameTextForPlayer(playerid,"This Is An ~b~Blue Exemple!",3000,2); // show this text is classid is 1, (Second AddPlayerClass)
        case 3: GameTextForPlayer(playerid,"This Is An ~r~Green Exemple!",3000,2);
        case 4: GameTextForPlayer(playerid,"This Is An ~p~Pink Exemple!",3000,2);
    }
    return 1;
}
And about the dialog, use ShowPlayerDialog function and OnPlayerDialogResponse to get the player responses.

https://sampforum.blast.hk/showthread.php?tid=379247 - Tutorial

Randon skin is easy too, just create an array to store the skin numbers and do a Random selection over these array numbers...

At The Top

pawn Код:
new TuckerSkins[10] // Create a 10 "slots" variable and assign a skin value for each "slot" (Remeber: Slots are 0-9, not 1-10)
{
    1,2,3,4,5,6,7,8,9,10
}
Now call this stock function where you want (such as OnPlayerSpawn, CMD, etc)

pawn Код:
SetPlayerRandomTruckerSkin(playerid);
And put the stock at the end of the script
pawn Код:
stock SetPlayerRandomTruckerSkin(playerid)
{
    new resultskin = random(sizeof TruckerSkins);
    SetPlayerSkin(playerid,resultskin);
}



Wrong - KomplettMaster - 05.01.2013

-WRONG-


Re: [HELP]Needs Help With Classes In Dialog - KomplettMaster - 05.01.2013

Quote:
Originally Posted by arakuta
Посмотреть сообщение
You must put the texts at the public OnPlayerRequestClass...

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    switch(classid) // Instead of use a lot of conditions, we go directly to the classid condition
    {
        case 0: GameTextForPlayer(playerid,"This Is An ~r~Red Exemple!",3000,2); // show this text is classid is 0, (First AddPlayerClass)
        case 1: GameTextForPlayer(playerid,"This Is An ~b~Blue Exemple!",3000,2); // show this text is classid is 1, (Second AddPlayerClass)
        case 3: GameTextForPlayer(playerid,"This Is An ~r~Green Exemple!",3000,2);
        case 4: GameTextForPlayer(playerid,"This Is An ~p~Pink Exemple!",3000,2);
    }
    return 1;
}
And about the dialog, use ShowPlayerDialog function and OnPlayerDialogResponse to get the player responses.

https://sampforum.blast.hk/showthread.php?tid=379247 - Tutorial

Randon skin is easy too, just create an array to store the skin numbers and do a Random selection over these array numbers...

At The Top

pawn Код:
new TuckerSkins[10] // Create a 10 "slots" variable and assign a skin value for each "slot" (Remeber: Slots are 0-9, not 1-10)
{
    1,2,3,4,5,6,7,8,9,10
}
Now call this stock function where you want (such as OnPlayerSpawn, CMD, etc)

pawn Код:
SetPlayerRandomTruckerSkin(playerid);
And put the stock at the end of the script
pawn Код:
stock SetPlayerRandomTruckerSkin(playerid)
{
    new resultskin = random(sizeof TruckerSkins);
    SetPlayerSkin(playerid,resultskin);
}
Thanks Helpful But.. I Want Class Selection In Dialogs Like :

The DiALOG Under Class Selection


Re: [HELP]Needs Help With Classes In Dialog - KomplettMaster - 05.01.2013

No One??


Re: [HELP]Needs Help With Classes In Dialog - aslan890 - 05.01.2013

Can i use that code?


Re: [HELP]Needs Help With Classes In Dialog - KomplettMaster - 06.01.2013

Yes sure.