[Help]Weapon buy system
#1

Can anyone give me hint how to make /buy system for DM server so a dialog box appear and players can buy guns for cash? and also tell me how if one player kill someone all his money transfer to the murderer.. Please help me
Reply
#2

pawn Код:
#define DIALOG_GUNLIST   19934

ShowPlayerDialog(playerid, DIALOG_GUNLIST, DIALOG_STYLE_LIST, "Choose gun", "gun1\ngun2\ngun3\ngun4\ngun5\ngun6\ngun7\ngun8\ngun9", "buy", "close");

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_GUNLIST){
        if(response){
            switch(listitem)){
                case 0:
                {
                    //Selected Item: "gun1"
                }
                case 1:
                {
                    //Selected Item: "gun2"
                }
                case 2:
                {
                    //Selected Item: "gun3"
                }
                case 3:
                {
                    //Selected Item: "gun4"
                }
                case 4:
                {
                    //Selected Item: "gun5"
                }
                case 5:
                {
                    //Selected Item: "gun6"
                }
                case 6:
                {
                    //Selected Item: "gun7"
                }
                case 7:
                {
                    //Selected Item: "gun8"
                }
                case 8:
                {
                    //Selected Item: "gun9"
                }
            }
        }
        else{
            //The player has pressed "buy".
            switch(listitem{
                case 0:
                {
                    //Selected Item: "gun1"
                }
                case 1:
                {
                    //Selected Item: "gun2"
                }
                case 2:
                {
                    //Selected Item: "gun3"
                }
                case 3:
                {
                    //Selected Item: "gun4"
                }
                case 4:
                {
                    //Selected Item: "gun5"
                }
                case 5:
                {
                    //Selected Item: "gun6"
                }
                case 6:
                {
                    //Selected Item: "gun7"
                }
                case 7:
                {
                    //Selected Item: "gun8"
                }
                case 8:
                {
                    //Selected Item: "gun9"
                }
            }
        }
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)