Help -
P<3TS - 01.08.2012
If a player is in minigame then he cant use anyother cmd except /kill
Code is this
pawn Код:
if(Minigame[playerid]) return GameTextForPlayer(playerid, " ~y~ type /kill to exit",3000,3);
I want to add a text like "type /kill to exit this minigame"
pawn Код:
SendClientMessage(playerid,yellow,"type /kill to exit from this Mini Game.");
How can i add this clientmessage along with the code i shown above?
Re: Help -
Misiur - 01.08.2012
pawn Код:
if(Minigame[playerid]) {
SendClientMessage(playerid,yellow,"type /kill to exit from this Mini Game.");
return GameTextForPlayer(playerid, " ~y~ type /kill to exit",3000,3);
}
Re: Help -
P<3TS - 01.08.2012
Is it possible to add everything in 1 line? because i added this in all cmds (in more than 100 cmds)
pawn Код:
if(Minigame[playerid]) return GameTextForPlayer(playerid, " ~y~ type /kill to exit",3000,3);
And it is very hard to replace every thing with
pawn Код:
if(Minigame[playerid]) {
SendClientMessage(playerid,yellow,"type /kill to exit from this Mini Game.");
return GameTextForPlayer(playerid, " ~y~ type /kill to exit",3000,3);
}
If it is in 1 line then i can easily replace it by pressing "H"
Re: Help -
Misiur - 01.08.2012
If you have good editor (like notepad++) multiline search and replace isn't a problem. Anyway, it is possible, because the compiler doesn't know what a new line is at all:
pawn Код:
if(Minigame[playerid]) { SendClientMessage(playerid,yellow,"type /kill to exit from this Mini Game."); return GameTextForPlayer(playerid, " ~y~ type /kill to exit",3000,3); }
It doesn't look nice, but works
Re: Help -
Devilxz97 - 01.08.2012
show me your dmminigame script ?
Re: Help -
P<3TS - 01.08.2012
ty it worked

+rep
Re: Help -
Devilxz97 - 01.08.2012
pawn Код:
#include a_samp
#include zcmd
new Minigame[MAX_PLAYERS]; //your variables
public OnPlayerConnect(playerid)
{
Minigame[playerid] = 0; //Relog/Reconnect will remove u from the DM :)
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
Minigame[playerid] = 0; //when player disconnect he will automatically remove from DM
return 1;
}
CMD:playdm(playerid, params[])
{
if(Minigame[playerid] == 1) return SendClientMessage(playerid,-1,"type /kill to exit from this Mini Game.");
//Your cords here
return 1;
}
CMD:kill(playerid, params[])
{
SetPlayerHealth(playerid, 0); //Setplayerhealth to 0
Minigame[playerid] = 0; //this will remove the player from dm
return 1;
}
//if you want to disable other cmd when u in DM , this is the example
CMD:v(playerid, params[])
{
if(Minigame[playerid] == 1)
{
SendClientMessage(playerid, -1,"You cant use this commands if you are in DM minigames");
}
//your cords
return 1;
}
try this