SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 31/08/2010, 10:09 AM   #1
pryor94
Little Clucker
 
Join Date: May 2010
Posts: 10
Reputation: 0
Question Team Death Match

I need to find out how to make Teams spawn at different place's and random spawn....
(-1385.2020,507.8355,18.2294,81.0479,0,0,0,0,0,0); // Red Team Spawn
(147.8706,2501.1167,16.4844,287.1192,0,0,0,0,0,0); // Blue Team Spawn
pryor94 is offline   Reply With Quote
Old 31/08/2010, 10:17 AM   #2
LarzI
High-roller
 
LarzI's Avatar
 
Join Date: Apr 2007
Location: Norway
Posts: 3,554
Reputation: 130
Default Re: Team Death Match

pawn Code:
new
    Float:gRandomSpawn[maxspawnsinhere][3] =
    {
         {0.0, 0.0, 0.0},
         {0.0, 0.0, 0.0}
    };

//onplayerspawn
new iRandom = random( sizeof( gRandomSpawn ));
SetPlayerPos( playerid, gRandomSpawn[iRandom][0], gRandomSpawn[iRandom][1], gRandomSpawn[iRandom][2] );

That is an easy code which will spawn player at one of the coords you added in the variable (randomly chosen).


Onplayerspawn, to make teams spawn at different places, just do a check if he's a blue or red player, then spawn him on the correct location.
LarzI is offline   Reply With Quote
Old 31/08/2010, 10:24 AM   #3
Nekrus2
Little Clucker
 
Nekrus2's Avatar
 
Join Date: Aug 2010
Posts: 43
Reputation: 0
Default Re: Team Death Match

pawn Code:
if (gTeam[playerid] == TEAM_RED);
{
SetPlayerPos(playerid,-1385.2020,507.8355,18.2294,81.0479);
}
if (gTeam[playerid]) == TEAM_BLUE);
{
SetPlayerPos(playerid,147.8706,2501.1167,16.4844,287.1192);
}

ok try this
put this in OnPlayerSpawn
its untested done from my head (as i have not got pawn on this computer and i will put correction to this as i get back to my computer if i done something wrong )
EDIT: someone was faster ... xD
__________________

82.19.22.175:7777
[PL].::Ultimate DeathMatch::.[PL]
Beta Tests
Nekrus2 is offline   Reply With Quote
Old 29/05/2012, 11:40 AM   #4
Gangs_Rocks
Big Clucker
 
Join Date: Feb 2012
Location: Mars
Posts: 115
Reputation: 13
Default Re: Team Death Match

http://forum.sa-mp.com/showthread.php?t=346614
Gangs_Rocks is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Team Death Match Patrikas Scripting Help 4 29/05/2012 11:50 AM
Server Restart on all players on team death lSCARl Help Archive 1 11/08/2010 02:09 PM
-| [Off Topic] |- [Adelanto] The Unforgiven Team Death Match Sandman-x Español/Spanish 11 11/07/2010 06:37 AM
SFTDM - San Fierro Team Death Match Final Version By Wilton Borim. wilton Filterscripts 38 01/03/2010 10:35 PM


All times are GMT. The time now is 04:00 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.