06.04.2012, 16:16
how to make when player kill in dm player spawn in dm and when player type /leavedm player left dm
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
new bool: IsPlayerInDM[MAX_PLAYERS];
IsPlayerInDM[playerid] = false;
dcmd(dmjoin, 6, cmdtext); dcmd(leavedm, 7, cmdtext);
dcmd_dmjoin(playerid, params[]) { #pragma unused params if(IsPlayerInDM[playerid] == true) SendClientMessage(playerid, -1, "You're Already in DM"); else { IsPlayerInDM[playerid] = true; //Do the rest of things to go to dm, for example, teleport player, give him weapons, etc... } return 1; }
if(IsPlayerInDM[playerid] == true) SetPlayerPos(playerid, "coord x", "coord y", "coord z") // coordinates of the dm spawn
dcmd_leavedm(playerid, params[]) { #pragma unused params if(IsPlayerInDM[playerid] == false) SendClientMessage(playerid, -1, "You're not in DM"); else IsPlayerInDM[playerid] = false; return 1; }
dcmd_joindm(playerid, params[])
{
if(IsPlayerInDM[playerid] == true)
{
SendClientMessage(playerid,-1,"You are already in a DM event!");
}
else
{
SetPlayerPos(playerid, POS HERE);
SetPlayerInterior(playerid, InteriorIDHERE);
SendClientMessage(playerid,-1,"You are not in a DM event, Good luck!");
IsPlayerInDM[playerid] = false;
}
return 1;
}