public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == DeathMatch)
{
Deathmatchon = true;
SendClientMessage(playerid, -1, "There is already a death match on!");
{
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;
}
Deathmatchon = false;
C:\Users\BLACK\Desktop\Test\filterscripts\DeathMatch.pwn(75) : error 033: array must be indexed (variable "Deathmatchon")
new Deathmatchon[MAX_PLAYERS]; new DMPlayer[MAX_PLAYERS];
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == Deathmatch)
{
if(!response) return 0;
{
switch(listitem)
{
case 0:
{
ShowPlayerDialog(playerid, 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, 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, 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");
}
}
}
}
if(dialogid == LSDM)
{
if(!response) return 0;
{
switch(listitem)
{
case 0:
{
DMPlayer = true;
Deathmatchon = true;
SetPlayerPos(playerid, 2798.2031,-1465.9199,24.1875);
GivePlayerWeapon(playerid, 28, 999999);
SetPlayerHealth(playerid, 100);
return 1;
}
}
if(dialogid == LVDM)
{
if(!response) return 0;
{
switch(listitem)
{
case 0:
{
DMPlayer = true;
Deathmatchon = true;
SetPlayerPos(playerid, 1061.1685,2080.8584,10.8203);
GivePlayerWeapon(playerid, 24, 999999);
SetPlayerHealth(playerid, 100);
return 1;
}
}
if(dialogid == LVDM)
{
if(!response) return 0;
{
switch(listitem)
{
case 0:
{
DMPlayer = true;
Deathmatchon = true;
SetPlayerPos(playerid, -2787.9775,-268.9075,7.1875);
GivePlayerWeapon(playerid, 26, 999999);
SetPlayerHealth(playerid, 100);
return 1;
}
}
}
}
}
}
}
}
return 1;
}
Deathmatchon = false;
instead of
Deathmatchon[playerid/i] = false;
new Deathmatchon[MAX_PLAYERS];
new Deathmatchon;
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;
}
Deathmatchon[playerid] = false;
do it EDIT: sorry change pawn Код:
pawn Код:
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;
}