01.08.2012, 10:48
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;
}