Little help please
#5

Quote:
Originally Posted by Ryz
Посмотреть сообщение
Deathmatchon[playerid] = false;

do it

EDIT:

sorry

change
pawn Код:
new Deathmatchon[MAX_PLAYERS];
to
pawn Код:
new Deathmatchon;
and correct

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == DeathMatch)
    {
       if (Deathmatchon == true)
       {
           SendClientMessage(playerid, -1, "There is already a death match on!");
       }
       else if (Deathmatchon == false)
       {
           ShowPlayerDialog(playerid, Deathmatch, DIALOG_STYLE_LIST, "DeathMatch list", "LS carpark DM\nLV warehouse DM\nSF tennis courts" , "Yes", "No"); // Add more if you want!
       }
    }
    return 1;
}
You're wrong, if you're going to hold false and true in a variable use booleans.


Edit it to your needs. It won't work as how it is. Edit the pickup's coordinates.
pawn Код:
#include <streamer>

new bool:gDeathMatchState = false,
gDeathMatch;

#define DIALOG_DEATHMATCH 0
#define DIALOG_LSDM 1
#define DIALOG_LVDM 2
#define DIALOG_SFDM 3

public OnGameModeInit()
{
    gDeathMatch = CreateDynamicPickup(19193, 1, 0.0, 0.0, 0.0, -1, -1, -1, 100.0);
    return 1;
}

public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
    if(pickupid == gDeathMatch)
    {
        if(gDeathMatchState == true) return SendClientMessage(playerid, -1, "There is already a death match on!");
        else if(gDeathMatchState == false) return ShowPlayerDialog(playerid, DIALOG_DEATHMATCH, DIALOG_STYLE_LIST, "DeathMatch list", "LS carpark DM\nLV warehouse DM\nSF tennis courts" , "Yes", "No");
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    siwtch(dialogid)
    {
        case DIALOG_DEATHMATCH:
        {
            if(!response) return 1;
            else if(response)
            {
                switch(listitem)
                {
                    case 0: ShowPlayerDialog(playerid, DIALOG_LSDM, DIALOG_STYLE_MSGBOX, "LS carpark DM", "You have chosen LS carpark DM, do you want to start the death match?", "Yes", "No");
                    case 1: ShowPlayerDialog(playerid, DIALOG_LVDM, DIALOG_STYLE_MSGBOX, "LV warehouse DM", "You have chosen LV warehouse DM, do you want to start the death match?", "Yes", "No");
                    case 2: ShowPlayerDialog(playerid, DIALOG_SFDM, DIALOG_STYLE_MSGBOX, "SF tennis courts DM", "You have chosen SF tennis courts DM, do you want to start the death match?", "Yes", "No");
                }
            }
        }
        case DIALOG_LSDM:
        {
            if(!response) return 1;
            else if(response)
            {
                gDeathMatchState = true;
                SetPlayerPos(playerid, 2798.2031,-1465.9199,24.1875);
                GivePlayerWeapon(playerid, 28, 999999);
                SetPlayerHealth(playerid, 100);
            }
        }
        case DIALOG_LVDM:
        {
            if(!response) return 1;
            else if(response)
            {
                gDeathMatchState = true;
                SetPlayerPos(playerid, 1061.1685,2080.8584,10.8203);
                GivePlayerWeapon(playerid, 24, 999999);
                SetPlayerHealth(playerid, 100);
            }
        }
        case DIALOG_SFDM:
        {
            if(!response) return 1;
            else if(response)
            {
                gDeathMatchState = true;
                SetPlayerPos(playerid, -2787.9775,-268.9075,7.1875);
                GivePlayerWeapon(playerid, 26, 999999);
                SetPlayerHealth(playerid, 100);
            }
        }
    }
    return 1;
}
Add me on Skype if you would like further assistance. Skype: sickattack.
Reply


Messages In This Thread
Little help please - by LeXuZ - 13.12.2014, 22:18
Re: Little help please - by Mic_H - 14.12.2014, 02:05
Re: Little help please - by LeXuZ - 14.12.2014, 14:31
Re: Little help please - by Ryz - 14.12.2014, 14:46
Re: Little help please - by SickAttack - 14.12.2014, 15:05
Re: Little help please - by Ryz - 14.12.2014, 16:07

Forum Jump:


Users browsing this thread: 2 Guest(s)