How to make Random spawns for Deathmatch
#1

How make Random spawn when a player types /dm
And a person will be frozen for 15seconds and after that if there is no player in the deathmatch then player will spawn
if there is players then the players will be unfrozen and also
It gives a message SCM 15seconds left to join %s deathmatch.
How to make deathmatch names.
Reply
#2

pawn Код:
//Top of script:
enum dmSpawns {
Float:dmLoc[3]
}
new dmSpawn[][dmSpawns] = {
X,Y,Z,
X,Y,Z,
X,Y,Z,
X,Y,Z
}
//In command:
new rand = random(5); //Number of X Y Z (from above) + 1
SetPlayerPos(playerid,dmSpawn[rand][dmLoc][0],dmSpawn[rand][dmLoc][1],dmSpawn[rand][dmLoc][2]);
Reply
#3

How to make that time thingy?
There are different types of deathmatches in different places so how i can make for each dm?
Reply
#4

Names?

pawn Код:
//Top:
enum dmSpawns {
dmName[20],Float:dmLoc[3],dmStarted=0,dmTimer
}
new dmSpawn[][dmSpawns] = {
"Team DM",X,Y,Z,
"Team DM",X,Y,Z,
"Team DM",X,Y,Z,
"Team DM",X,Y,Z
}

//In command:
new rand = random(5); //Number of X Y Z (from above) + 1
if(dmSpawn[rand][dmStarted] == 2) return SendClientMessage(playerid,0xFFFFFFFF,"This DM already started, better luck next time.");
new string[128];
SetPlayerPos(playerid,dmSpawn[rand][dmLoc][0],dmSpawn[rand][dmLoc][1],dmSpawn[rand][dmLoc][2]);
if(dmSpawn[rand][dmStarted] == 0)
{
if(dmSpawn[rand][dmStarted] == 1) return 1;
if(dmSpawn[rand][dmStarted] == 2) return 1;
dmSpawn[rand][dmStarted] = 1;
format(string,sizeof(string),"15 seconds left to join %s deathmatch.",dmSpawn[rand][dmName]);
SendClientMessageToAll(0xFFFFFFFF,string);
dmSpawn[rand][dmTimer] = SetTimerEx("DM_Start",15000,false,"i",rand);
}
//Bottom:
forward DM_Start(eid);
public DM_Start(eid)
{
dmSpawn[rand][dmStarted] = 2;
new string[100];
format(string,sizeof(string),"%s deathmatch has started!",dmSpawn[eid][dmName]);
SendClientMessageToAll(0xFFFFFFFF,string);
KillTimer(dmSpawn[eid][dmTimer]);
return 1;
}
Completely untested.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)