DM Area -
Beljulji - 25.09.2012
Код:
if (strcmp(cmdtext,"/sfdm", true , 5) ==0)
{
SetPlayerPos(playerid,-1390.3849, 1494.4746, 1.6152);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"%s has joined /sfdm.",pName);
SendClientMessageToAll(orange,string);
GivePlayerWeapon(playerid,24,100);//------Deagle
GivePlayerWeapon(playerid,27,100);//------Combat Shotgun
GivePlayerWeapon(playerid,34,100);//------Sniper Rifle
SendClientMessage(playerid,orange,"Welcome To The Sf Death match! to Exit use /exitdm!!!");
return 1;
}
what i need to add here, on /exitdm and onplayerspawn?
Код:
if (strcmp(cmdtext,"/exitdm", true , 7) == 0)
{
SetPlayerPos(playerid,1958.3319, -2355.5676, 13.0000);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 0, 1);
SendClientMessage(playerid,yellow,"You have exited the Dm!");
return 1;
}
so when player die in dm area autoteleport back to that area there are 7 dm areas this is one of them.
Re : DM Area Again! -
Varkoll_ - 25.09.2012
PHP код:
GivePlayerWeapon(playerid, 0, 1);
This isn't useful.
Can you give us your onplayerspawn code ?
Re: DM Area Again! i posted this thread 7 times!!! if anyone know pls help me! -
Beljulji - 25.09.2012
here
Код:
public OnPlayerSpawn(playerid)
{
new PlayerName[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s has spawned.", PlayerName);
SendClientMessageToAll(yellow, string);
PlayerPlaySound(playerid, 1184, 2127.2194,2368.6323,10.8203);
EnableBoast[playerid] = 0;
TextDrawShowForPlayer(playerid, UStuntingTextDraw);
return 1;
}
Re : DM Area Again! i posted this thread 7 times!!! if anyone know pls help me! -
Varkoll_ - 25.09.2012
Oh, okay, you want to autoteleport back to the DM area when the player die ? You must to create a global variable with one parameter:
PHP код:
new dm1[MAX_PLAYERS];
And in your commands you assign a value to this variable:
PHP код:
if (strcmp(cmdtext,"/sfdm", true , 5) ==0)
{
SetPlayerPos(playerid,-1390.3849, 1494.4746, 1.6152);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"%s has joined /sfdm.",pName);
SendClientMessageToAll(orange,string);
GivePlayerWeapon(playerid,24,100);//------Deagle
GivePlayerWeapon(playerid,27,100);//------Combat Shotgun
GivePlayerWeapon(playerid,34,100);//------Sniper Rifle
SendClientMessage(playerid,orange,"Welcome To The Sf Death match! to Exit use /exitdm!!!");
dm1[playerid] = 1;
return 1;
}
if (strcmp(cmdtext,"/exitdm", true , 7) == 0)
{
SetPlayerPos(playerid,1958.3319, -2355.5676, 13.0000);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 0, 1);
SendClientMessage(playerid,yellow,"You have exited the Dm!");
dm1[playerid] = 0;
return 1;
}
And when the player spawn (when he dies, he respawn, so, onplayerspawn is called).
PHP код:
public OnPlayerSpawn(playerid)
{
new PlayerName[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s has spawned.", PlayerName);
SendClientMessageToAll(yellow, string);
PlayerPlaySound(playerid, 1184, 2127.2194,2368.6323,10.8203);
EnableBoast[playerid] = 0;
TextDrawShowForPlayer(playerid, UStuntingTextDraw);
if(dm1[playerid] == 1) // If player is in dm1
{
return OnPlayerCommandText(playerid, "/sfdm"); // You force the player to put the command
}
return 1;
}
You make the same for all your DM
Sorry for my bad english
Re: DM Area Again! i posted this thread 7 times!!! if anyone know pls help me! -
Beljulji - 25.09.2012
tnx man ill rep you

and one question do i need to add if(dm1blablabla to all teleports or dm1,2,3,4,5,6,7 ?
Re : DM Area Again! i posted this thread 7 times!!! if anyone know pls help me! -
Varkoll_ - 25.09.2012
dm1,2,3,4,5,6,7
Thanks for rep me
Re: DM Area Again! i posted this thread 7 times!!! if anyone know pls help me! -
zDevon - 25.09.2012
Edit: I was too slow. A bit cleaner though
Repeat what I've done for the other deathmatches and there you have it.
At the top of your script,
pawn Код:
new isinsfdm[MAX_PLAYERS];//creating a new global variable for each player.
Your new commands,
pawn Код:
if (strcmp(cmdtext,"/sfdm", true , 5) ==0)
{
isinsfdm[playerid] = 1;//setting that variable to true for the player using this command.
SetPlayerPos(playerid,-1390.3849, 1494.4746, 1.6152);
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"%s has joined /sfdm.",pName);
SendClientMessageToAll(orange,string);
GivePlayerWeapon(playerid,24,100);//------Deagle
GivePlayerWeapon(playerid,27,100);//------Combat Shotgun
GivePlayerWeapon(playerid,34,100);//------Sniper Rifle
SendClientMessage(playerid,orange,"Welcome To The Sf Death match! to Exit use /exitdm!!!");
return 1;
}
if (strcmp(cmdtext,"/exitdm", true , 7) == 0)
{
isinsfdm[playerid] = 0;//setting the variable back to 0, or false, since the player has left the dm.
SetPlayerPos(playerid,1958.3319, -2355.5676, 13.0000);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid, 0, 1);
SendClientMessage(playerid,yellow,"You have exited the Dm!");
return 1;
}
OnPlayerSpawn,
pawn Код:
public OnPlayerSpawn(playerid)
{
if(isinsfdm[playerid] == 1) SetPlayerPos(playerid,-1390.3849, 1494.4746, 1.6152);//checking if the player is in the sf dm, and if they are, set their position to the sf dm spawn.
new PlayerName[MAX_PLAYER_NAME],
string[128];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "%s has spawned.", PlayerName);
SendClientMessageToAll(yellow, string);
PlayerPlaySound(playerid, 1184, 2127.2194,2368.6323,10.8203);
EnableBoast[playerid] = 0;
TextDrawShowForPlayer(playerid, UStuntingTextDraw);
return 1;
}
Re : DM Area Again! i posted this thread 7 times!!! if anyone know pls help me! -
Varkoll_ - 25.09.2012
Edited