13.12.2014, 22:18
Hello, i've been trying to make a deathmatch, I am having trouble with a lot of things on it, like if it's checking if another death match is on and sending the player to the death match..
First problem:
This should stop the player from opening the dialog if there is another death match on but it doesn't, and i am getting an error on this line
with the error of
I've tried setting the false to 0 instead and that didn't work.
this is how it's defined as.
second problem:
After the player has clicked on the yes button to allow them in the deathmatch it does nothing, just closes the dialog.
I can't find out what i'm doing wrong, I have been looking for the errors for over an hour and couldn't fix them.
If you're able to help me that would be great!
Thank you!
First problem:
pawn Код:
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;
}
pawn Код:
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];
second problem:
After the player has clicked on the yes button to allow them in the deathmatch it does nothing, just closes the dialog.
pawn Код:
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;
}
If you're able to help me that would be great!
Thank you!