[Solved]DM Spawn
#1

A question about DM spawn
hello,I got a problem in DM spawn.I wanna make :
1.players can only respawn in DM when they joined a DM.
2.players respawn in one of special class bases when they haven't join any DM.
the codeI click the "Insert Code" but it doesn't work...)

new inDM[MAX_PLAYERS];
new DMzone[MAX_PLAYERS];

forward SetPlayerDMSpawn4(playerid);
new FloatMRandomSpawns4[7][3] = {
{2718.2190,2773.4170,77.3594},
{2633.0801,2829.2290,122.9219},
{2593.2629,2638.4695,114.0313},
{2689.9285,2785.1096,59.0212},
{2562.8196,2715.4285,22.9507},
{2616.1682,2748.8623,23.8222},
{2503.5588,2690.1899,74.8281}
};

public SetPlayerDMSpawn4(playerid){
new rand = random(sizeof(DMRandomSpawns4));
SetPlayerPos(playerid, DMRandomSpawns4[rand][0], DMRandomSpawns4[rand][1], DMRandomSpawns4[rand][2]);
return 1;}

if (strcmp("/DM4", cmdtext, true, 10) == 0){
ResetPlayerWeapons(playerid);
SetPlayerDMSpawn4(playerid);
GivePlayerWeapon(playerid, 34, 50);
DMzone[playerid] = 1;
inDM[playerid] = 4;
SetPlayerInterior(playerid,0);
return 1;}

public OnPlayerSpawn
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, 2500);
GivePlayerWeapon(playerid, 8, 1);

if ( TimeC[playerid] == 0 )
{
TogglePlayerControllable(playerid, 1);
return 1;
}

DMzone[playerid] = 0;
inDM[playerid] = 0;

return 1;
}




I guess I should add something at the "public OnPlayerSpawn",but how?
Maybe use the given value of "inDM"?
When I tried I often cause errors...
So can anybody tell me exactly how?
P.S:TimeC is a Time change system,it has nothing about DM.
Reply
#2

here put this in your command


Код:
new DMspawns = random(7);
switch(DMspawns)
{
case 0: SetPlayerPos(playerid,2718.2190,2773.4170,77.3594);
case 1: SetPlayerPos(playerid,2633.0801,2829.2290,122.9219);
case 2: SetPlayerPos(playerid,2593.2629,2638.4695,114.0313);
case 3: SetPlayerPos(playerid,2689.9285,2785.1096,59.0212);
case 4: SetPlayerPos(playeird,2562.8196,2715.4285,22.9507);
case 5: SetPlayerPos(playerid,2616.1682,2748.8623,23.8222);
case 6: SetPlayerPos(playerid,2503.5588,2690.1899,74.8281);
}
they must be in a new level (meaning you need to fix indentation) so i hope it helps you.
Reply
#3

Hey,
use
Код:
pawn Код:
//ur code
and make better indentation, more ppl will help you.
PS:use modify button to modify your topic~
Reply
#4

Quote:
Originally Posted by pagie1111
here put this in your command


Код:
new DMspawns = random(7);
switch(DMspawns)
{
case 0: SetPlayerPos(playerid,2718.2190,2773.4170,77.3594);
case 1: SetPlayerPos(playerid,2633.0801,2829.2290,122.9219);
case 2: SetPlayerPos(playerid,2593.2629,2638.4695,114.0313);
case 3: SetPlayerPos(playerid,2689.9285,2785.1096,59.0212);
case 4: SetPlayerPos(playeird,2562.8196,2715.4285,22.9507);
case 5: SetPlayerPos(playerid,2616.1682,2748.8623,23.8222);
case 6: SetPlayerPos(playerid,2503.5588,2690.1899,74.8281);
}
they must be in a new level (meaning you need to fix indentation) so i hope it helps you.
OK,I'll try it soon,if any more problem I may ask,hope you dont mind ,thx.
Reply
#5

Quote:
Originally Posted by yezizhu
Hey,
use
Код:
pawn Код:
//ur code
and make better indentation, more ppl will help you.
PS:use modify button to modify your topic~
I see,i know how to use it next time,thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)