Need help ( Respawn player on DM )
#1

Hello , im see some servers using re spawn on dm area so when player type /CT (Cop Team) and dead respawn this player to /CT with out to type again /CT Is that possible? i have more than one dm area /Area69 /CT /RT /SNIPER /MINIGUN ETC...

This is some what i have in pawn

Код:
new DMZone[MAX_PLAYERS];



new Float:MiniRandomSpawn[8][3] =
{
	{2973.9443,-1752.1270,22.4850},
	{2959.5354,-1754.3094,22.4850},
	{2937.8621,-1748.6287,22.4850},
	{2917.7844,-1748.3462,22.4850},
	{2919.3574,-1766.4543,25.3385},
	{2945.0110,-1788.9114,22.4928},
	{2950.1199,-1783.8212,28.1615},
	{2945.9575,-1775.0850,44.1091}
};
new Float:RandomPlayerSpawns[3][3] = {
	{404.79,2457.21,16.5000},
	{-2633.79,1360.32,7.12},
	{1116.8577,2494.9219,432.4359}
};
new Float:RandomPlayerSpawnsWang[3][3] = {
	{-1949.7513,263.2258,41.0471},
	{-1949.7513,263.2258,41.0471},
	{-1949.7513,263.2258,41.0471}
};
new Float:RandomPlayerSpawnsMinigun[3][3] = {
	{2764.1074,-2488.8137,13.4859},
	{2784.3933,-2417.9187,13.6345},
	{2703.2720,-2482.8025,27.0536}
};
new Float:RandomPlayerSpawnsDildo[3][3] = {
	{2100.6616,2069.3052,11.2963},
	{2100.6616,2069.3052,11.2963},
	{2093.1885,2069.3838,11.2963}
};
new Float:RandomPlayerSpawnsCtd[6][3] = {
	{1250.8558,-820.9926,1084.0078},
	{1277.5756,-823.7945,1085.6328},
	{1282.6505,-829.6953,1089.9375},
	{1288.2511,-817.5930,1089.9375},
	{1282.3177,-805.3218,1089.9375},
	{1239.5696,-829.0618,1083.2805}
};
new Float:RandomPlayerSpawnsSniper[3][3] = {
	{1661.4003,-1643.6135,87.3735},
	{1646.8998,-1643.5101,87.3735},
	{1647.9318,-1630.3092,87.3750}
};
new Float:RandomPlayerSpawnsTeepee[3][3] = {
	{-842.5834,2751.8113,45.8516},
	{-842.5834,2751.8113,45.8516},
	{-842.5834,2751.8113,45.8516}
};
new Float:RandomPlayerSpawnsbf[3][3] = {
	{2962.61, 4202.89, 41.94},
	{2928.58, 4309.11, 41.94},
	{2923.21, 4071.65, 41.94}
};
new Float:RandomPlayerSpawnsarea69[3][3] = {
	{213.82, 1867.57, 13.14},
	{212.23, 1811.78, 21.86},
	{161.7736,1930.5045,33.8984}
};
new Float:RandomPlayerSpawnsFlame[3][3] = {
	{637.80, 834.92, -42.96},
	{620.19, 888.97, -35.17},
	{591.24, 927.26, -37.48}
};
new Float:RandomPlayerSpawnsWar[3][3] = {
	{-499.18,-524.06,41.47},
	{-467.6955,-524.7691,25.5178},
	{-609.21,-512.58,33.52}
};
new Float:RandomPlayerSpawnsAk47[3][3] = {
	{1410.08, 2773.28, 10.82},
	{1259.89, 2806.65, 14.18},
	{1260.06, 2750.76, 10.82}
};
public OnPlayerSpawn(playerid)
{
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,26,500);
    GivePlayerWeapon(playerid,24,500);
    PlayerInfo[playerid][SpawnAngle] = 0.0; //so when you leave and another player comes, the camera will start from start
    PlayerInfo[playerid][SpawnDance] = true; //to not execute to much timers
    KillTimer( PlayerInfo[playerid][SpawnTimer] ); //to kill it, since its useless now
    PlayerPlaySound(playerid, 1186, 0.0, 0.0, 0.0); // (blank sound) to shut the music up
    SetCameraBehindPlayer(playerid); //to prevent some bugs
    PlayCrimeReportForPlayer(playerid, playerid, 3);
    SetPlayerFightingStyle(playerid, FIGHT_STYLE_KUNGFU);
	PlayerPlaySound(playerid, 1098,-119.9460,23.1096,12.2238);
    DMZone[playerid] = 0;
	new rand = random(sizeof(RandomPlayerSpawns));
	SetPlayerPos(playerid, RandomPlayerSpawns[rand][0], RandomPlayerSpawns[rand][1], RandomPlayerSpawns[rand][2]);
	return 1;
    }
public OnPlayerDeath(playerid, killerid, reason)
    {
    SendDeathMessage(killerid, playerid, reason);
    KillingSpree[playerid] = 0;
    KillingSpree[killerid]++;
    new file[100],Name[MAX_PLAYER_NAME],Ip[16],name[MAX_PLAYER_NAME];
	GetPlayerName(giveplayerid, name, sizeof(name));
	GetPlayerName(playerid,Name,sizeof(Name));
	GetPlayerIp(playerid,Ip,sizeof(Ip));
	format(file,sizeof(file),PlayerFile,Name);
    if(KillingSpree[killerid] >= 21)
     {
      new pName[MAX_PLAYER_NAME]; GetPlayerName(killerid,pName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"* %s is Owner Death Match!",pName, KillingSpree50);
      SendClientMessageToAll(RED, string);
	  GameTextForPlayer(killerid, "~r~Owner ~G~Death Match~W~!", 1000, 1);
     }
    if(KillingSpree[killerid] == 20)
     {
      new pName[MAX_PLAYER_NAME]; GetPlayerName(killerid,pName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"* %s is HolyShit kills and killing spree ended! (Kills: 20/20)",pName, KillingSpree50);
      SendClientMessageToAll(RED, string);
	  GameTextForPlayer(killerid, "~G~Leader KILL~W~!", 1000, 1);
     }
    if(KillingSpree[killerid] == 6)
     {
      new pName[MAX_PLAYER_NAME]; GetPlayerName(killerid,pName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"* %s in Rival! {F3FF02}(Kills: 6/20)",pName, KillingSpree35);
      SendClientMessageToAll(0xFFFF00AA, string);
	  GameTextForPlayer(killerid, "~G~MONSTER KILLER~N~~Y~Rival Kill ~g~+100$ ~W~+1 score", 1000, 1);
     }
    if(KillingSpree[killerid] == 5)
     {
	  GameTextForPlayer(killerid, "~G~I''m the ~P~KING~N~~R~HAHAHAHA", 1000, 1);
     }
    if(KillingSpree[killerid] == 4)
     {
	  GameTextForPlayer(killerid, "~W~The ~B~owner ~W~shoot!", 1000, 1);
     }
    if(KillingSpree[killerid] == 3)
     {
      new pName[MAX_PLAYER_NAME]; GetPlayerName(killerid,pName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"* %s is the Legendary Hero! {F3FF02}(Kills : 3/20)",pName, KillingSpree10);
      SendClientMessageToAll(0x000080AA, string);
	  GameTextForPlayer(killerid, "~R~ Im the ~g~King~W~!~N~~b~Rival Kill!", 1000, 1);
     }
    if(KillingSpree[killerid] == 2)
     {
      new pName[MAX_PLAYER_NAME]; GetPlayerName(killerid,pName,MAX_PLAYER_NAME);
      new string[128]; format(string,sizeof(string),"* %s is Super Killing Spree! {B8FF02}(Kills : 2/20)",pName, KillingSpree5);
      SendClientMessageToAll(0xFFFFFFAA, string);
	  GameTextForPlayer(killerid, "~r~SNAKE ~R~ATTACK~W~!~N~~G~+100$", 1000, 1);
     }
    if(KillingSpree[killerid] == 1)
     {
	  GameTextForPlayer(killerid, "~B~Baby Human~W~!~N~~g~+1 score", 1000, 1);
     }
	if( DMZone[killerid] >= 1)
	{
		GivePlayerMoney(killerid, 100);
		SetPlayerScore(playerid,GetPlayerScore(playerid)-10);
		SetPlayerScore(killerid,GetPlayerScore(killerid)+50);
		GameTextForPlayer(playerid, "~R~Death",3000,2);
		PlayCrimeReportForPlayer(killerid, killerid, 3);
	}
	if( DMZone[killerid] == 0)
	{
		GivePlayerMoney(playerid, 100);
		SetPlayerScore(killerid,GetPlayerScore(killerid)+10);
		SetPlayerScore(playerid,GetPlayerScore(playerid)-10);
		GameTextForPlayer(playerid, "~W~Death",3000,2);
		PlayCrimeReportForPlayer(killerid, killerid, 3);
	}
	return 1;
    }
OnPlayerCommandText

Код:
	if(strcmp("/Flame", cmdtext, true, 10) == 0)
 {
        if(DMZone[playerid] == 1) return ShowPlayerDialog(playerid,TELEWARN,DIALOG_STYLE_MSGBOX,"Error:","Teleporting Error!\n\n- Sorry, But you can't Teleport to another area while in a Dm Zone","OK","Leave Dm");
        new rand = random(sizeof(RandomPlayerSpawns));
    	SetPlayerHealth(playerid,100);
        ResetPlayerWeapons(playerid);
        GivePlayerWeapon(playerid,37,9999999);
        GetPlayerName(playerid, pName, sizeof(pName));
        format(string, sizeof(string), "[DM] {F81414}%s {FFFFFF}has joined DeathMatch Mode {C77D87}[ /FLAME ] ", pName, playerid);
        SendClientMessageToAll(COLOR_TELEPORT, string);
    	SendClientMessage(playerid, RED,"* Server: {FFFFFF}For leave dm type {F3FF02}/LeaveDm");
     	SetPlayerPos(playerid, RandomPlayerSpawnsFlame[rand][0], RandomPlayerSpawnsFlame[rand][1], RandomPlayerSpawnsFlame[rand][2]);
        DMZone[playerid] = 1;
        return 1;
Any one help please?
Reply
#2

First of all you need multiple variables for that.

If you want when player is in Flame DM, And he dies and he will respawn in Flame.

Then here is it.

OnPlayerSpawn

pawn Код:
if(DMZone[playerid] == 0)
{
    new rand = random(sizeof(RandomPlayerSpawns));
    SetPlayerPos(playerid, RandomPlayerSpawns[rand[0],RandomPlayerSpawns[rand]1],RandomPlayerSpawns[rand[2]);
}
if(DMZone[playerid] == 1)
{
    SetPlayerPos(playerid, RandomPlayerSpawnsFlame[rand][0], RandomPlayerSpawnsFlame[rand][1], RandomPlayerSpawnsFlame[rand][2]);
}
Reply
#3

C:\Documents and Settings\MaHdy\Desktop\Paradisev4.pwn(2394) : error 028: invalid subscript (not an array or too many subscripts): "rand"
C:\Documents and Settings\MaHdy\Desktop\Paradisev4.pwn(2394) : warning 215: expression has no effect
C:\Documents and Settings\MaHdy\Desktop\Paradisev4.pwn(2394) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\MaHdy\Desktop\Paradisev4.pwn(2394) : error 029: invalid expression, assumed zero
C:\Documents and Settings\MaHdy\Desktop\Paradisev4.pwn(2394) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

I think we must asking if player was on Flame becouse they are more than one dmz like minigun ak47..
Reply
#4

line 2394 is which line?
Reply
#5

pawn Код:
if(DMZone[playerid] == 0)
{
    new rand = random(sizeof(RandomPlayerSpawns));
    SetPlayerPos(playerid, RandomPlayerSpawns[rand][0],RandomPlayerSpawns[rand][1],RandomPlayerSpawns[rand][2]);
}
if(DMZone[playerid] == 1)
{
    SetPlayerPos(playerid, RandomPlayerSpawnsFlame[rand][0], RandomPlayerSpawnsFlame[rand][1], RandomPlayerSpawnsFlame[rand][2]);
}
Davz*|*Criss either you typed this on a phone or you were really sleepy :P you missed a few closing and opening parentheses.
Reply
#6

Not working :S.
Reply
#7

Not working ehh?

What do you actually mean then lol?
Reply
#8

removed shit lagg spammed my post
Reply
#9

Quote:
Originally Posted by Davz*|*Criss
Посмотреть сообщение
Not working ehh?

What do you actually mean then lol?
Huh? Nothing happened..
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)