Please help!! Please! DM exit -
fie - 28.07.2011
I have made the Area51 dm so it tp's you there on random spawn and gives you weapons.
Now.
i have the /teles which brings a teleport menu up.
When they select to play on a Deathmatch on the /teles menu i want it so when they try and type /teles in the DM it pops up saying you cannot do this in a Deathmatch! type /kill to leave
is there a way? if so how i do it?
If so it would be a big help
Thanks
Re: Please help!! Please! DM exit -
Calgon - 28.07.2011
Have you created any variables which store information about whether the player is attending a DM match? If not, that's what you should do - create a PVar or normal array boolean to store whether it's true or false if the player is attending a DM match, you set it to true when they begin to attend the event and you set it to false when they die in OnPlayerDeath.
Re: Please help!! Please! DM exit -
ylleron - 28.07.2011
recently i solved this.
do you using, dcmd ?
Re: Please help!! Please! DM exit -
fie - 28.07.2011
Any Help on how to create PVars?
Re: Please help!! Please! DM exit -
grand.Theft.Otto - 28.07.2011
Here's an example of what you would do:
pawn Код:
// top of script
new InDM[MAX_PLAYERS]; // starting the variable
// kill command
InDm[playerid] = 0; // so the server knows when they die, they will not be in the dm anymore
// teleport menu selection (for when they teleport)
InDM[playerid] = 1;
// /teles command
if(InDM[playerid] == 1)
{
return SendClientMessage(playerid,color,"You must exit this DM before you go to a new one. Type /kill first");
}
// onplayerdeath
InDM[playerid] = 0;
Hope you understand. You should get the idea?
Re: Please help!! Please! DM exit -
fie - 28.07.2011
Nope i dont use dcmd.. Do i need it?
Re: Please help!! Please! DM exit -
ylleron - 28.07.2011
No but,
anything else do you use, you have to (if you want PVars)
create in every command (zcmd = public) condition about "If is player in DM, is yes send message about type kill to return, if no player can use the command
How to set PVar ?
SetPVarInt(playerid, "IN_DM", 1);
Код:
if (GetPVarInt(playerid, "IN_DM") == 1)
{
SendClientMessage(playerid, -1, "Type kill to use this command");
return false;
}
would be better if you used boolean
when player come to DM set IN_DM as 1
and in /kill set IN_DM (in kill you couldn't set condition!)
Re: Please help!! Please! DM exit -
fie - 28.07.2011
Quote:
Originally Posted by grand.Theft.Otto
Here's an example of what you would do:
pawn Код:
// top of script
new InDM[MAX_PLAYERS]; // starting the variable
// kill command
InDm[playerid] = 0; // so the server knows when they die, they will not be in the dm anymore
// teleport menu selection (for when they teleport)
InDM[playerid] = 1;
// /teles command
if(InDM[playerid] == 1) { return SendClientMessage(playerid,color,"You must exit this DM before you go to a new one. Type /kill first"); }
// onplayerdeath
InDM[playerid] = 0;
Hope you understand. You should get the idea?
|
Thanks
It workes but is there a way to disable the menu?
because the menu still shows and you can use it to tp :P
and when you select a tp it says you must type /kill lol
Thanks anyways
Re: Please help!! Please! DM exit -
ylleron - 28.07.2011
HideMenuForPlayer(menuid, playerid);
do you think this one ?
Re: Please help!! Please! DM exit -
Kaperstone - 28.07.2011
lol...all here gave you an option..
so i give my own suggest/option ::
here:
pawn Код:
new bool:pInDM[MAX_PLAYERS]; // = PlayerInDM -- you can rename it to whatever you want... [MAX_PLAYERS] define the - playerid
// ok now you can make : pInDM[playerid] == 1 or pInDM[playerid] == 0 --- 1 = true 0 = false
public OnPlayerCommandText(playerid, cmdtext[])
{ // command line....
if (strcmp("/dm", cmdtext, true, 10) == 0)
{
{
pInDM[playerid] = 1 // you can make " pInDM[playerid] == 0 " if you want... but remember the 0 mean thet the player in DM ,, well i decided then "1" mean then player in DM
// ok i put player in DM
SetPlayerPos(playerid, 0, 0, 10); // under thet(pInDM) you can put whatever you want...
return 1;
}
if (strcmp("/healme", cmdtext, true, 10) == 0)
{
{ // checks if player in DM
if(pInDM[playerid] == 1) //
{
SendClientMessage(playerid, 0x667788, "Exit DM please(/exitdm)");
}else{ // if player is not in DM
SetPlayerHealth(playerid, 100.0);
}
return 1;
}
if (strcmp("/exitdm", cmdtext, true, 10) == 0)
{ // checks if player is not in DM
if(pInDM[playerid] == 0)
{ // if player is not in DM
SendClientMessage(playerid, 0x667788, "You are not in DM place");
}else{ // if player in DM
// i put player out of DM
pInDM[playerid] == 0
// you can put here whatever you want :)
SetPlayerPos(playerid, 0, 0, 10.0);
}
return 1;
}
return 0;
}
i hope you understanded me and i helped you