[Help] Class selection
#1

How can I make a class selection like this;
I've made it going like you choose skin and then class, but I want to do it like this;
Choose the class then three skins out of that class like
Grove
Vagos
Aztecas
You choose Grove
Now you need to choose a skin out of it, how do I script that?
Here's the pastebin of my scripty if somebody wants to edit it.

http://pastebin.com/7DNHFvVw

Thanks
Reply
#2

Anybody?!
Reply
#3

You have to skip the class selection by setting the player to spectate and after the team is selected you'll send the player back to the class selection and continue how it's supposed to.

pawn Код:
#define DIALOG_TEAM 123

new gPlayerTeam[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid)
{
    gPlayerTeam[playerid] = -1;
    return 1;
}
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(gPlayerTeam[playerid] == -1)
    {
        TogglePlayerSpectating(playerid, 1); // Start spectating -> Will hide the class selection
       
        //Show dialog...
        ShowPlayerDialog(playerid, DIALOG_TEAM, DIALOG_STYLE_LIST, "Teams", "Grove\nBallas", "Select", "");

        return 0;
    }
    else
    {
        // Player is in the class selection.

        // SetPlayerPos... etc.
        return 1;
    }
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_TEAM)
    {
        if(response)
        {
            gPlayerTeam[playerid] = listitem; // Set team ID
           
            TogglePlayerSpectating(playerid, 0); // Quit spectating -> Will send the player back to the class selection
        }
    }

    return 1;
}
Reply
#4

C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (309) : error 030: compound statement not closed at the end of file (started at line 172)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
This is what I get after all.
Reply
#5

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_TEAM)
    {
        if(response)
        {
            gPlayerTeam[playerid] = listitem; // Set team ID
           
            TogglePlayerSpectating(playerid, 0); // Quit spectating -> Will send the player back to the class selection
        }
    }
}
return 1;
}
try this.
Reply
#6

Definatively not that.

C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (180) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (182) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (184) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (186) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (201) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (203) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (219) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (221) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (237) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (239) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (254) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (256) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (271) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (273) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (289) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (291) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (307) : error 010: invalid function or declaration
C:\Users\MARKO\Desktop\Learning\gamemodes\Test.pwn (30 : warning 203: symbol is never used: "PickedClass"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


17 Errors.

DEFINATIVELY THAT IS NOT A FIX. LOOK WHAT IT HAS DONE
Reply
#7

http://pastebin.com/rqBHYpAJ Ma' script.
Reply
#8

Anybody? I'm desperate for help
Reply
#9

pawn Код:
#include <a_samp>
#include <zcmd>

#define COLOR_WHITE 0xFFFFFFFF
#define COL_GREEN          "{6EF83C}"
#define COL_WHITE          "{FFFFFF}"
#define COLOR_RED          0xAA3333AA
#define COLOR_GREEN        0x33AA33AA
#define GROVE 1
#define BALLA 2
#define AZTECAS 3
#define AMMUNITION 4
#define SLUT 5
#define BOSS 6
#define VAGOS 7
#define DIALOG_TEAM 123

new gPlayerTeam[MAX_PLAYERS];
new gPlayerClass[MAX_PLAYERS];
new PickedClass[MAX_PLAYERS];

main() {}

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Just Testin'");
    AddPlayerClass(107,2521.2722,-1678.7083,15.3522,82.8959,31,500,24,999,32,400);
    AddPlayerClass(106,2521.2722,-1678.7083,15.3522,82.8959,31,500,24,999,32,400);
    AddPlayerClass(105,2521.2722,-1678.7083,15.3522,82.8959,31,500,24,999,32,400);
    AddPlayerClass(108,2521.2722,-1678.7083,15.3522,82.8959,37,900,18,2020,30,999);
    AddPlayerClass(109,2521.2722,-1678.7083,15.3522,82.8959,37,900,18,2020,30,999);
    AddPlayerClass(110,2521.2722,-1678.7083,15.3522,82.8959,37,900,18,2020,30,999);
    AddPlayerClass(102,2521.2722,-1678.7083,15.3522,82.8959,22,9999,31,999,30,999);
    AddPlayerClass(103,2521.2722,-1678.7083,15.3522,82.8959,27,2700,22,9999,31,999);
    AddPlayerClass(104,2521.2722,-1678.7083,15.3522,82.8959,27,2700,22,9999,31,999);
    AddPlayerClass(114,2521.2722,-1678.7083,15.3522,82.8959,26,200,23,400,32,999);
    AddPlayerClass(115,2521.2722,-1678.7083,15.3522,82.8959,26,200,23,400,32,999);
    AddPlayerClass(116,2521.2722,-1678.7083,15.3522,82.8959,26,200,23,400,32,999);
    AddPlayerClass(120,2521.2722,-1678.7083,15.3522,82.8959,8,0,31,999,24,999);
    AddPlayerClass(179,2521.2722,-1678.7083,15.3522,82.8959,30,500,22,490,29,800);
    AddPlayerClass(194,2521.2722,-1678.7083,15.3522,82.8959,10,0,31,2000,30,2000);

    AddStaticVehicle(447,2529.5759,-1678.2296,19.9419,91.5106,75,2);
    AddStaticVehicle(490,2494.3008,-1654.5840,13.5311,249.8709,0,0);
    AddStaticVehicle(451,2473.8311,-1700.7242,13.2273,177.6675,125,125);
    AddStaticVehicle(522,2528.0742,-1689.7404,13.2581,80.6985,6,25);
    AddStaticVehicle(522,2527.1887,-1689.2676,13.2201,63.1784,6,25);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    if(gPlayerTeam[playerid] == -1)
    {
        TogglePlayerSpectating(playerid, 1);
        ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "nGrove Class\nBalla Class\nVagos Class\nAztecas Class\nSlut Class\nAmmunution class\nBoss Class", "Choose","");
        return 0;
    }
    else
    {
        SetPlayerPos(playerid,2519.8140,-1678.8607,14.8426);
        SetPlayerFacingAngle(playerid,63.1557);
        SetPlayerCameraPos(playerid,2513.6995,-1675.4047,13.5563);
        SetPlayerCameraLookAt(playerid,2519.8140,-1678.8607,14.8426);
        return 1;
    }
}

public OnPlayerConnect(playerid)
{
    gPlayerTeam[playerid] = -1;
    GameTextForPlayer(playerid, "Hello, Welcome to our server, remember to read /rules!",15000,6);
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(gPlayerClass[playerid] == GROVE)
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 31, 1000);//m4
        GivePlayerWeapon(playerid, 25, 1000);//mp5
        GivePlayerWeapon(playerid, 24, 7000);//deagle
    }
    else if(gPlayerClass[playerid] == BALLA)//This is for the Second Sniper class.
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 30, 2250);//sniper
        GivePlayerWeapon(playerid, 29, 2250);//mp5
        GivePlayerWeapon(playerid, 4, 1);//knife
    }
    else if(gPlayerClass[playerid] == AZTECAS)//This is for the Second Engineer class.
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 27, 700);//spas12
        GivePlayerWeapon(playerid, 23, 8000);//silent pistol
        GivePlayerWeapon(playerid, 30, 2000);//rpg
        GivePlayerWeapon(playerid, 16, 5);//grenade
    }
    else if(gPlayerClass[playerid] == VAGOS)//This is for the Second Jetrooper class.
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 32, 500);//tec-9
        GivePlayerWeapon(playerid, 30, 500);//colt
        GivePlayerWeapon(playerid, 25, 200);//knife
    }
    else if(gPlayerClass[playerid] == SLUT)//This is for the Second Pilot class.
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 27, 1000);//deagle
        GivePlayerWeapon(playerid, 29, 1000);//moltove
        GivePlayerWeapon(playerid, 10, 1);//shotgun
    }
    else if(gPlayerClass[playerid] == AMMUNITION)//This is for the Second Spy class.
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 29, 990);//mp5
        GivePlayerWeapon(playerid, 26, 100);//silent pistol
        GivePlayerWeapon(playerid, 4, 1);//knife
        GivePlayerWeapon(playerid, 30, 500);//moltove
    }
    else if(gPlayerClass[playerid] == BOSS)//This is for the Second Spy class.
    {
        TogglePlayerControllable(playerid, 1);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid, 31, 990);//mp5
        GivePlayerWeapon(playerid, 22, 100);//silent pistol
        GivePlayerWeapon(playerid, 16, 3);//knife
        GivePlayerWeapon(playerid, 32, 500);//moltove
    }
    return 1;
}

CMD:dildo(playerid,params[])
{
    if(gPlayerClass[playerid] == SLUT)//if the player is slut
    {
        SetPlayerHealth(playerid, 80);
    }
    return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_TEAM)
    {
        if(response)
        {
            gPlayerTeam[playerid] = listitem; // Set team ID

            TogglePlayerSpectating(playerid, 0); // Quit spectating -> Will send the player back to the class selection
        }
    }
    if(dialogid == 999)//dialog id response
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    if(GetPlayerScore(playerid) >= 0)//if player have 0 score then  he can choose this class
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the Grove as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Grove Class:", "{F81414}Abilities:\n{FFFFFF}Gang class. Good at shooting.\n\n{F81414}Weapons:\n\n{FFFFFF}M4\n{FFFFFF}Shotgun\n{FFFFFF}Deagle", "Play","");
                        gPlayerClass[playerid] = GROVE;//setting the class to soldier
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        ResetPlayerWeapons(playerid);
                        GivePlayerWeapon(playerid, 31, 1000);//m4
                        GivePlayerWeapon(playerid, 25, 1000);//mp5
                        GivePlayerWeapon(playerid, 24, 7000);//deagle
                    }
                }
                case 1:
                {
                    if(GetPlayerScore(playerid) >= 0)//if player have 0 score then  he can choose this class
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the Ballas as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Ballas Class:", "{F81414}Abilities:\n{FFFFFF}You're invisible on map.You don't have much foes.Ammunition and slut are your friends.\n\n{F81414}Weapons:\n\n{FFFFFF}AK-47\n{FFFFFF}Mp5\n{FFFFFF}Knife", "Play","");
                        gPlayerClass[playerid] = BALLA;//setting the class to Sniper
                        PickedClass[playerid] = 1;
                        RemovePlayerMapIcon(playerid, 0);
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        ResetPlayerWeapons(playerid);
                        GivePlayerWeapon(playerid, 30, 2250);//sniper
                        GivePlayerWeapon(playerid, 29, 2250);//mp5
                        GivePlayerWeapon(playerid, 4, 1);//knife
                    }
                }
                case 2:
                {
                    if(GetPlayerScore(playerid) >= 0)//if player have 0 score then  he can choose this class
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the Aztecas as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Azteca Class:", "{F81414}Abilities:\n{FFFFFF}You fight against BALLAS and VAGOS. They are your only enemies..\n\n{F81414}Weapons:\n\n{FFFFFF}Spas12\n{FFFFFF}Silent Pistol\n{FFFFFF}M4\n{FFFFFF}Grenade", "Play","");
                        gPlayerClass[playerid] = AZTECAS;//setting the class to engineer
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        ResetPlayerWeapons(playerid);
                        GivePlayerWeapon(playerid, 27, 700);//spas12
                        GivePlayerWeapon(playerid, 23, 8000);//silent pistol
                        GivePlayerWeapon(playerid, 30, 2000);//rpg
                        GivePlayerWeapon(playerid, 16, 5);//grenade
                    }
                }
                case 3:
                {
                    if(GetPlayerScore(playerid) >= 0)//if player have 0 score then  he can choose this class
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the Vagos as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Vagos Class:", "{F81414}Abilities:\n{FFFFFF}Good class if you want to go solo.\n\n{F81414}Weapons:\n\n{FFFFFF}Shotgun\n{FFFFFF}M4\n{FFFFFF}Mp5", "Play","");
                        gPlayerClass[playerid] = VAGOS;//setting the class to jettrooper
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        ResetPlayerWeapons(playerid);
                        GivePlayerWeapon(playerid, 32, 500);//tec-9
                        GivePlayerWeapon(playerid, 30, 500);//colt
                        GivePlayerWeapon(playerid, 25, 200);//knife
                    }
                }
                case 4:
                {
                    if(GetPlayerScore(playerid) >= 20)//if player have 0 score then  he can choose this class
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the Slut as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Slut Class:", "{F81414}Abilities:\n{FFFFFF}Best class: You can heal yourself with /dildo.\n\n{F81414}Weapons:\n\n{FFFFFF}Combat Shotgun\n{FFFFFF}Mp5\n{FFFFFF}Dildo", "Play","");
                        gPlayerClass[playerid] = SLUT;//setting the class to pilot
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        ResetPlayerWeapons(playerid);
                        GivePlayerWeapon(playerid, 27, 10000);//deagle
                        GivePlayerWeapon(playerid, 29, 10000);//moltove
                        GivePlayerWeapon(playerid, 10, 1);//shotgun
                    }
                }
                case 5:
                {
                    if(GetPlayerScore(playerid) >= 0)//if player have 0 score then  he can choose this class
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the Ammunition as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Ammunition Class:", "{F81414}Abilities:\n{FFFFFF}You sell weapons, do you really need a description? /dis\n\n{F81414}Weapons:\n\n{FFFFFF}Sawnoff\n{FFFFFF}Mp5\n{FFFFFF}Knife\n{FFFFFF}AK-47", "Play","");
                        gPlayerClass[playerid] = AMMUNITION;//setting the class to Spy
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        ResetPlayerWeapons(playerid);
                        GivePlayerWeapon(playerid, 29, 990);//mp5
                        GivePlayerWeapon(playerid, 26, 100);//silent pistol
                        GivePlayerWeapon(playerid, 4, 1);//knife
                        GivePlayerWeapon(playerid, 30, 500);//moltove
                    }
                }
                case 6:
                {
                    if(GetPlayerScore(playerid) >= 0)//if player have 0 score then  he can choose this class
                    {
                        SendClientMessage(playerid, COLOR_WHITE, "You chose the Boss as your class.");
                        ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Boss Class:", "{F81414}Abilities:\n{FFFFFF}You're the boss. You choose your enemies. /dis\n\n{F81414}Weapons:\n\n{FFFFFF}M4\n{FFFFFF}Grenade\n{FFFFFF}Pistol\n{FFFFFF}Molotov", "Play","");
                        gPlayerClass[playerid] = BOSS;//setting the class to Spy
                        PickedClass[playerid] = 1;
                        SetPlayerVirtualWorld(playerid, 0);
                        TogglePlayerControllable(playerid, 1);
                        ResetPlayerWeapons(playerid);
                        GivePlayerWeapon(playerid, 31, 990);//mp5
                        GivePlayerWeapon(playerid, 22, 100);//silent pistol
                        GivePlayerWeapon(playerid, 16, 3);//knife
                        GivePlayerWeapon(playerid, 32, 500);//moltove
                    }
                }
            }
        }
    }
    return 0;
}
Reply
#10

http://pastebin.com/Zq9uH8P6

here fixed

not tested
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)