SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 05/04/2014, 11:41 PM   #1
yvoms
Huge Clucker
 
yvoms's Avatar
 
Join Date: Nov 2009
Location: Las Venturas
Posts: 454
Reputation: 26
Default Creating spawns

So hey guys im creating my own gamemode,
tough im having a minor issue,

Im using this in my script :

Code:
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?
__________________

yvoms is offline   Reply With Quote
Old 05/04/2014, 11:50 PM   #2
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,067
Reputation: 2660
Default Re: Creating spawns

Check your interiors. Reset it at the top of OnPlayerSpawn.
__________________
Vince is offline   Reply With Quote
Old 06/04/2014, 12:10 AM   #3
yvoms
Huge Clucker
 
yvoms's Avatar
 
Join Date: Nov 2009
Location: Las Venturas
Posts: 454
Reputation: 26
Default Re: Creating spawns

Vince kunt u misschien eventjes helpen En mij toevoegen op skype ; yvomartino heb echt heel even hulp nodig.
__________________

yvoms is offline   Reply With Quote
Old 06/04/2014, 12:17 AM   #4
VerticalGaming
Big Clucker
 
Join Date: Mar 2014
Posts: 138
Reputation: 3
Default Re: Creating spawns

pawn Code:
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);
    }
VerticalGaming is offline   Reply With Quote
Old 06/04/2014, 12:20 AM   #5
yvoms
Huge Clucker
 
yvoms's Avatar
 
Join Date: Nov 2009
Location: Las Venturas
Posts: 454
Reputation: 26
Default Re: Creating spawns

Thanks i found it already!
Many thanks!
__________________

yvoms is offline   Reply With Quote
Old 06/04/2014, 12:22 AM   #6
VerticalGaming
Big Clucker
 
Join Date: Mar 2014
Posts: 138
Reputation: 3
Default Re: Creating spawns

Quote:
Originally Posted by yvoms View Post
Thanks i found it already!
Many thanks!

No problem
VerticalGaming 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
Spawns Deleting/Creating. MrPlatinum Scripting Help 0 30/09/2012 07:39 AM
How to set different spawns? MastahServers Help Archive 6 14/05/2010 06:53 PM
Random Spawns + Previous Spawns XtremeChio Help Archive 2 01/09/2009 01:57 PM


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


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