Little Help! +rep
#1

how can i make /sc i use this /sc command to change class then it will show player dialog of classes but i want to

make it that it will show after next death how to make like that? that it will show player message that

"Returning to Class Selection after next death" then when player dies and go to his pos then dialog will come showing

classes how can i make like that please some-one help ill rep him!
Reply
#2

"Push F4"
Reply
#3

pawn Код:
CMD:sc(playerid,params[])
{
ShowClass[playerid] = 1;
SendClientMessage(playerid,-1,"You will be returned to class selection after death");
return 1;
}

public OnPlayerDeath(...)
{
if(ShowClass[playerid] == 1) return ForceClassSelection(playerid);
}
Reply
#4

u guys don't understand i mean it will show the player message that "You will be in class selection after next death"

when the buy uses /sc command then when he dies it will show with dialog the classes like

1. Soldier
2. BALBLA

i did not mean team change i mean when player use /sc message will come that "Changing class after next death"

then when dies can change class!
Reply
#5

Stick to what the poster is asking for, he most likely knows how to change to class selection... but that's not what he's asking for.
pawn Код:
#include <a_samp>
new ReturnToClass[MAX_PLAYERS]; //Add this at the top of your script, before calling any public functions.
new HasDied[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    ReturnToClass[playerid] = 0;
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(HasDied[playerid] == 1)
    {
        ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Select A Class", "Class 1\nClass 2\nClass 3", "Select", "Exit");
        HasDied[playerid] = 0;
    }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(ReturnToClass[playerid] == 1)
    {
        HasDied[playerid] = 1;
        //ForceClassSelection(playerid); //You Can Remove This If You Do Not Want It To Work This Way.
        ReturnToClass[playerid] = 0;
    }
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp(cmdtext, "/sc", true) == 0)
    {
        if(ReturnToClass[playerid] == 1) return SendClientMessage(playerid, 0xFF0000FF, "You Have Already Requested To Return To Class Selection.");
        if(GetPlayerState(playerid) == PLAYER_STATE_WASTED) return SendClientMessage(playerid, 0xFF0000FF, "You Must Be Alive To Use This Command!");
        ReturnToClass[playerid] = 1;
        SendClientMessage(playerid, 0x00FF00FF, "Returning To Class Selection Upon Death.");
        return 1;
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == dialogid) //replace dialogid with the number you chose for ShowPlayerDialog
    {
        if(response)
        {
            switch(listitem)
            {
                case 0://Chose Class 1
                {
                //Code Here
                }
                case 1://Chose Class 2
                {
                //Code Here
                }
                case 2://Chose Class 3
                {
                //Code Here
                }
            }
        }
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)