19.12.2013, 23:37
Hello there,
I need some help with respawning in Dm .
I created a variable called inDM, and applied it to the dm command, i also made a /leavedm command, but i was wondering how can i make the player respawn in dm zone if he is in one, just to keep in mind that i want multiple Dm zone and i am planning to keep the same command "/leavedm" for all the dm zones.
Here is my DM command Code:
Just in case, my leave dm
Please help with this problem. Thanks in advance
I need some help with respawning in Dm .
I created a variable called inDM, and applied it to the dm command, i also made a /leavedm command, but i was wondering how can i make the player respawn in dm zone if he is in one, just to keep in mind that i want multiple Dm zone and i am planning to keep the same command "/leavedm" for all the dm zones.
Here is my DM command Code:
pawn Код:
COMMAND:dm(playerid,params[])
{
if(!strcmp(params, "1"))//if area 51 was typed after a space
{
if(inDM[playerid] == 1)
{
SendClientMessage(playerid,COLOR_PINK2,"Error: You are already in DeathMatch Arena");
}
else
{
new rand = random(sizeof(Randlounge));
new string[500];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
inDM[playerid] = 1;
GetPlayerPos(playerid, p[0], p[1], p[2]);
SetPlayerPos(playerid,Randdm[rand][0], Randdm[rand][1],Randdm[rand][2]);
Freeze(playerid,5);
format(string, sizeof(string),"{CC8152}%s has joined Deathmatch 1 | Weapons: Deagle - Shotgun", name);
SendClientMessageToAll(-1,string);
SendClientMessage(playerid,0x92DADEAA,"Welcome to Deathmatch arena 1");
SendClientMessage(playerid,0xE3D68DAA,"Please wait 5 seconds for the objects to be loaded");
}
}
return 1;
}
pawn Код:
COMMAND:leavedm(playerid,params[])
{
if(inDM[playerid] == 0)
{
SendClientMessage(playerid,COLOR_PINK2,"Error: You are not in a Deathmatch Arena");
}
else
{
inDM[playerid] = 0;
SendClientMessage(playerid,COLOR_PINK2,"You left the DeathMatch Arena");
SetPlayerPos(playerid, p[0], p[1], p[2]);
}
return 1;
}