[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


Messages In This Thread
[Solved]DM Spawn - by Fly_luck - 06.08.2009, 12:02
Re: [Help]DM Spawn - by pagie1111 - 06.08.2009, 12:13
Re: [Help]DM Spawn - by yezizhu - 06.08.2009, 13:47
Re: [Help]DM Spawn - by Fly_luck - 06.08.2009, 15:29
Re: [Help]DM Spawn - by Fly_luck - 06.08.2009, 15:31

Forum Jump:


Users browsing this thread: 1 Guest(s)