PDA

View Full Version : How to make this??


Danyal
14/11/2011, 05:55 PM
CMD:leavedm(playerid, params[])
{
new pname[MAX_PLAYER_NAME];
if (SDZDM1 [playerid] == 0) return SendClientMessage (playerid, -1, "Defender[SDZ]: Not in the area DeathMatch!");
SetPlayerHealth (playerid, 0);
ResetPlayerWeapons (playerid);
SDZDM [playerid] = 0;
GetPlayerName(playerid, pname, sizeof(pname));
new string [256];
format (string, sizeof (string), "Defender[SDZ]: %s has left the area of DeathMatch 1! (/leavedm)", pname);
SendClientMessageToAll (-1, string);
return 1;
}

CMD:leavedm1(playerid, params[])
{
new pname[MAX_PLAYER_NAME];
if (SDZDM1 [playerid] == 0) return SendClientMessage (playerid, -1, "Defender[SDZ]: Not in the area DeathMatch 2!");
SetPlayerHealth (playerid, 0);
ResetPlayerWeapons (playerid);
SDZDM1 [playerid] = 0;
GetPlayerName(playerid, pname, sizeof(pname));
new string [256];
format (string, sizeof (string), "Defender[SDZ]: %s has left the area of DeathMatch 2! (/leavedm1)", pname);
SendClientMessageToAll (-1, string);
return 1;
}

CMD:leavedm2(playerid, params[])
{
new pname[MAX_PLAYER_NAME];
if (SDZDM2 [playerid] == 0) return SendClientMessage (playerid, -1, "Defender[SDZ]: Not in the area DeathMatch 3!");
SetPlayerHealth (playerid, 0);
ResetPlayerWeapons (playerid);
SDZDM2 [playerid] = 0;
GetPlayerName(playerid, pname, sizeof(pname));
new string [256];
format (string, sizeof (string), "Defender[SDZ]: %s has left the area of DeathMatch 3! (/leavedm2)", pname);
SendClientMessageToAll (-1, string);
return 1;
}


How to make above leave deathmatch commands into 1 commands like /leavedm and leaves player from a deathmatch zone


sorry for my bad english

Backwardsman97
14/11/2011, 06:04 PM
Try this.


CMD:leavedm(playerid, params[])
{
if(!SDZDM[playerid] && !SDZDM1[playerid] && !SDZDM2[playerid])
{
SendClientMessage (playerid, -1, "Defender[SDZ]: You aren't in the deathmatch area!");
return 1;
}
SetPlayerHealth(playerid, 0);
ResetPlayerWeapons(playerid);

SDZDM [playerid] = 0;
SDZDM1[playerid] = 0;
SDZDM2[playerid] = 0;

new
pname[MAX_PLAYER_NAME],
string [128];

GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(string, 128, "Defender[SDZ]: %s has left the area of DeathMatch! (/leavedm)", pname);

SendClientMessageToAll(-1, string);
return 1;
}

Danyal
14/11/2011, 06:09 PM
Thx It Work Now Another

CMD:sdzdm1(playerid, params[])
{
new pname[MAX_PLAYER_NAME];
if (SDZDM1 [playerid] == 1) return SendClientMessage (playerid, -1, "Defender[SDZ]: You're in the area DeathMatch 2!");
SDZDM1 [playerid] = 1;
SetPlayerPos (playerid, 188.61, 1895.91, 17.64);
SetPlayerInterior (playerid, 0);
ResetPlayerWeapons (playerid);
GivePlayerWeapon (playerid, 24, 99999);
GivePlayerWeapon (playerid, 26, 99999);
GivePlayerWeapon (playerid, 29, 99999);
GivePlayerWeapon (playerid, 31, 99999);
GivePlayerWeapon (playerid, 16, 5);
GetPlayerName(playerid, pname, sizeof(pname));
new string [256];
format (string, sizeof (string), "Defender[SDZ]: %s wants to kill people and has gone to the area DeathMatch 2! (/sdzdm1)", pname);
SendClientMessageToAll (-1, string);
return 1;
}

when player is in above dm zone they cant teleport to other locations

wumpyc
14/11/2011, 06:13 PM
maybe use on teleport commands if(IsPlayerInRangeOfPoint(188.61, 1895.91, 17.64,range) return SendClientMessage(playerid,COLOR_RED,"You can't teleport because you are in the DeathMatch2");

Danyal
15/11/2011, 07:34 AM
CMD:sdzdm1(playerid, params[])
{
new pname[MAX_PLAYER_NAME];
if (SDZDM [playerid] == 1) return SendClientMessage (playerid, -1, "Defender[SDZ]: You're in the area DeathMatch 2!");
SDZDM[playerid] = 1;
SetPlayerPos (playerid, 188.61, 1895.91, 17.64);
SetPlayerInterior (playerid, 0);
ResetPlayerWeapons (playerid);
GivePlayerWeapon (playerid, 24, 99999);
GivePlayerWeapon (playerid, 26, 99999);
GivePlayerWeapon (playerid, 29, 99999);
GivePlayerWeapon (playerid, 31, 99999);
GivePlayerWeapon (playerid, 16, 5);
GetPlayerName(playerid, pname, sizeof(pname));
new string [256];
format (string, sizeof (string), "Defender[SDZ]: %s wants to kill people and has gone to the area DeathMatch 2! (/sdzdm1)", pname);
SendClientMessageToAll (-1, string);
return 1;
}

CMD:sdzdm2(playerid, params[])
{
new pname[MAX_PLAYER_NAME];
if (SDZDM [playerid] == 1) return SendClientMessage (playerid, -1, "Defender[SDZ]: You're in the area DeathMatch 2!");
SDZDM[playerid] = 1;
SetPlayerPos (playerid, 963.418762, 2108.292480, 1011.030273);
SetPlayerInterior (playerid, 0);
ResetPlayerWeapons (playerid);
GivePlayerWeapon (playerid, 24, 99999);
GivePlayerWeapon (playerid, 26, 99999);
GivePlayerWeapon (playerid, 29, 99999);
GivePlayerWeapon (playerid, 31, 99999);
GivePlayerWeapon (playerid, 16, 5);
GetPlayerName(playerid, pname, sizeof(pname));
new string [256];
format (string, sizeof (string), "Defender[SDZ]: %s wants to kill people and has gone to the area DeathMatch 2! (/sdzdm1)", pname);
SendClientMessageToAll (-1, string);
return 1;
}

here is on player spawn

public OnPlayerSpawn(playerid)
{
SDZDM[playerid] = 0;
return 1;
}


teleport problem solved by other method but i want to make above cmd if player die it should respawn at dm zone not at spawn zone