[HELP]Needs Help With Classes In Dialog
#1

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

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

-WRONG-
Reply
#4

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

No One??
Reply
#6

Can i use that code?
Reply
#7

Yes sure.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)