PDA

View Full Version : Creating spawns


yvoms
05/04/2014, 11:41 PM
So hey guys im creating my own gamemode,
tough im having a minor issue,

Im using this in my script :


new Float:SpawnPoints[20][4] =
{
{2352.9812,1001.9236,10.8203,87.6178},
{2417.9851,1114.8572,10.8125,270.2919},
{2445.8699,1279.4567,10.8061,182.7706},
{2490.9990,1433.9799,10.8203,205.3045},
{2443.8264,1654.3289,10.8203,227.9582},
{1697.6488,1456.3223,10.7665,275.0996},
{1891.6893,2314.0139,10.8203,277.7439},
{1947.0715,2437.2217,10.8203,205.5250},
{2092.6616,2479.8145,10.8203,173.1116},
{2091.4067,2070.9500,10.8203,268.8218},
{2185.9917,2001.2933,10.8203,88.6423},
{2031.9304,1918.0876,12.3359,270.1340},
{1952.1302,2655.0112,10.8203,180.1662},
{994.6838,1985.7472,11.0389,272.6347},
{955.9548,1730.4478,8.6484,272.9977},
{-88.9428,1362.8306,10.2734,271.5778},
{-97.2324,1088.1873,19.7500,353.0189},
{-306.0002,1303.2164,53.6584,307.6807},
{-333.2935,1531.8217,75.3594,181.2123},
{-26.6790,2345.7227,24.1406,176.3719}
};


public OnPlayerSpawn(playerid)
{
if(MoneyGiven[playerid] != -1)
{
GivePlayerMoney(playerid, MoneyGiven[playerid]);
MoneyGiven[playerid] = -1;
}
if(JustLogged[playerid] == 1)
{
new s[64];
format(s,64,"Welcome back! We hope you enjoy.",GetName(playerid));

SendClientMessage(playerid,COLOR_GREEN,s);
JustLogged[playerid] = 0;
if(gTeam[playerid] >= 9) {
new rnd;
rnd = random(sizeof (SpawnPoints));
SetPlayerPos(playerid, SpawnPoints[rnd][0], SpawnPoints[rnd][1], SpawnPoints[rnd][2]);
SetPlayerFacingAngle(playerid, SpawnPoints[rnd][3]);
}


Whenever i spawn i first spawn in a grey area with no buildings etc, i have to kill myself before i spawn in a enviroment where there actually are buildings did i do anything wrong?

Vince
05/04/2014, 11:50 PM
Check your interiors. Reset it at the top of OnPlayerSpawn.

yvoms
06/04/2014, 12:10 AM
Vince kunt u misschien eventjes helpen En mij toevoegen op skype ; yvomartino heb echt heel even hulp nodig.

VerticalGaming
06/04/2014, 12:17 AM
public OnPlayerSpawn(playerid)
{
if(MoneyGiven[playerid] != -1)
{
GivePlayerMoney(playerid, MoneyGiven[playerid]);
MoneyGiven[playerid] = -1;
}
if(JustLogged[playerid] == 1)
{
new s[64];
format(s,64,"Welcome back! We hope you enjoy.",GetName(playerid));

SendClientMessage(playerid,COLOR_GREEN,s);
JustLogged[playerid] = 0;
if(gTeam[playerid] >= 9) {
new rnd;
rnd = random(sizeof (SpawnPoints));
SetPlayerPos(playerid, SpawnPoints[rnd][0], SpawnPoints[rnd][1], SpawnPoints[rnd][2]);
SetPlayerFacingAngle(playerid, SpawnPoints[rnd][3]);
SetPlayerInterior(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
}

yvoms
06/04/2014, 12:20 AM
Thanks i found it already!
Many thanks!

VerticalGaming
06/04/2014, 12:22 AM
Thanks i found it already!
Many thanks!


No problem ;)