Author Topic: Spawn problems?  (Read 7094 times)

0 Members and 3 Guests are viewing this topic.

Offline faizan12345

  • Street Thug
  • *
  • Posts: 22
  • VV Developer
    • View Profile
Spawn problems?
« on: February 14, 2012, 02:17:22 pm »
Iam using random spawn...
i wish that each player spawn at other locations differ from others....
like Tommy spawn around vercetti mansion and around mansion,
and Cop spawn on diferrent City Police Stations....

Can any one help me Please...

Offline Jay

  • Street Thug
  • *
  • Posts: 12
  • Please don't criticize me. . . Scripting 4 Free
    • View Profile
    • Real Movie's
Re: Spawn problems?
« Reply #1 on: February 14, 2012, 03:16:51 pm »
[pawn]
enum playerspawns {
    Float:spawnx,
    Float:spawny,
    Float:spawnz,
}
new RandomPlayerSpawns [ ] [playerspawns] =
{
{-999.5219   ,120.5592    ,9.2921},
   {-890.4131   ,-307.4079   ,11.0832},
   {-808.0995   ,-347.5157   ,10.7984},
   {-634.9841   ,-501.6519   ,11.0253},
   {-384.4496   ,-540.6746   ,17.2831},
   {205.3157    ,-502.1331   ,11.8203},
   {125.4754    ,-487.0941   ,12.1190},
   {33.2781     ,-642.0747   ,9.9650},
   {-614.8451   ,-1500.9324  ,8.8648},
   {-663.2899   ,769.8389    ,11.2795},
   {83.5795     ,-1461.6901  ,10.5655},
   {-1717.4724  ,-245.1584   ,14.8683},
   {-670.3488   ,607.9666    ,11.0845}
};
//theses go at the top
[/pawn]

[pawn]
public OnPlayerSpawn(playerid)
{
   new rand = random(sizeof(RandomPlayerSpawns));
   SetPlayerPos(playerid,RandomPlayerSpawns[rand][spawnx], RandomPlayerSpawns[rand][spawny], RandomPlayerSpawns[rand][spawnz],0,0);
   return 1;
}
[/pawn]

Offline faizan12345

  • Street Thug
  • *
  • Posts: 22
  • VV Developer
    • View Profile
Re: Spawn problems?
« Reply #2 on: February 14, 2012, 03:20:30 pm »
Yeah bro i put it,
But cop too spawn at mansion,,
I dont want that...
I want cop only spawn at police stations of different city,,

Offline faizan12345

  • Street Thug
  • *
  • Posts: 22
  • VV Developer
    • View Profile
Re: Spawn problems?
« Reply #3 on: February 14, 2012, 03:37:46 pm »
Thanks very very much brother.....

Offline jimmy

  • Wiseguy
  • **
  • Posts: 94
    • View Profile
Re: Spawn problems?
« Reply #4 on: February 14, 2012, 03:49:29 pm »
Nice Jay
Storm City Owner

Stormcity.smfnew.com

Offline faizan12345

  • Street Thug
  • *
  • Posts: 22
  • VV Developer
    • View Profile
Re: Spawn problems?
« Reply #5 on: February 14, 2012, 04:00:55 pm »
C:\Documents and Settings\Administrator\Desktop\New Folder (2)\BSG.pwn(342) : error 021: symbol already defined: "rand"
C:\Documents and Settings\Administrator\Desktop\New Folder (2)\BSG.pwn(343) : error 021: symbol already defined: "rand"
C:\Documents and Settings\Administrator\Desktop\New Folder (2)\BSG.pwn(344) : error 021: symbol already defined: "rand"
C:\Documents and Settings\Administrator\Desktop\New Folder (2)\BSG.pwn(345) : error 021: symbol already defined: "rand"

Offline faizan12345

  • Street Thug
  • *
  • Posts: 22
  • VV Developer
    • View Profile
Re: Spawn problems?
« Reply #6 on: February 14, 2012, 04:01:42 pm »
iam getting this error

Offline Jay

  • Street Thug
  • *
  • Posts: 12
  • Please don't criticize me. . . Scripting 4 Free
    • View Profile
    • Real Movie's
Re: Spawn problems?
« Reply #7 on: February 14, 2012, 04:16:22 pm »
Yeah bro i put it,
But cop too spawn at mansion,,
I dont want that...
I want cop only spawn at police stations of different city,,
[pawn]
public OnPlayerSpawn(playerid)
{
           new rand1 = random(sizeof(PoliceSpawns));
        new rand2 = random(sizeof(MedicalSpawns));
        new rand3 = random(sizeof(ArmySpawns));
           SetPlayerPos(playerid,PoliceSpawns[rand1][spawnx],PoliceSpawns[rand1][spawny],PoliceSpawns[rand1][spawnz],0,0);
        SetPlayerPos(playerid,MedicalSpawns[rand2][spawnx],MedicalSpawns[rand2][spawny],MedicalSpawns[rand2][spawnz],0,0);
        SetPlayerPos(playerid,ArmySpawns[rand3][spawnx],ArmySpawns[rand3][spawny],ArmySpawns[rand3][spawnz],0,0);
   return 1;
}
[/pawn]
« Last Edit: February 14, 2012, 04:25:17 pm by Jay »

Offline faizan12345

  • Street Thug
  • *
  • Posts: 22
  • VV Developer
    • View Profile
Re: Spawn problems?
« Reply #8 on: February 14, 2012, 04:19:51 pm »
Rocking JAY Rocking man...
Thanks Alot...

Offline faizan12345

  • Street Thug
  • *
  • Posts: 22
  • VV Developer
    • View Profile
Re: Spawn problems?
« Reply #9 on: February 14, 2012, 04:22:48 pm »
Hey the error removed but now when i spawn palyer the player Jumping jumping
And my Player start pos removed... what i do?

Offline Innocent Heart

  • Wiseguy
  • **
  • Posts: 51
  • Crime Investigation Department Owner
    • View Profile
    • Crime Investigaton Department
Re: Spawn problems?
« Reply #10 on: February 14, 2012, 04:42:27 pm »
Nice Work......... Jay .... Keep it up .!
Conatact Information :
Facebook:-www.facebook.com/dashingjaff
Youtube:-www.youtube.com/NooranScripter

====>My Server Info  < ========
ServerName :- CID-Server
Server Clan :- [D.R] Dakriders
Server Forum :- www.CidServer.tk
Clan Forum :-www.Drgang.tk
=====> DarkRiders Group <=====

Pm Me If U want To be Pro In Scripting !
Those Who Banned my Ip and My Freind's Ip They Are Big Fuckers...!

Offline sseebbyy

  • VC:MP Veteran
  • *****
  • Posts: 774
  • Immortal VC:MP Player
    • View Profile
    • Zombie Invasion => Server Forum [DEAD PROJECT]
Re: Spawn problems?
« Reply #11 on: February 14, 2012, 04:46:24 pm »
World Bounds somehow you changed?

Code: [Select]
SetWorldBounds(Float:x_max,Float:x_min,Float:y_max,Float:y_min);
For total map need to be this:

Code: [Select]
SetWorldBounds(5000.0,-5000.0,5000.0,-5000.0);
« Last Edit: February 14, 2012, 04:48:58 pm by sseebbyy »

Quote
Painful/Noob scripters acts like: I Am The Best Scripter Because I Announce My Releases With Big Font Size Without Giving Too Much Info' In The Hope They All Will Download And Check It. I Ignore Bad Replies, Replies That I Could Learn From, And Replies With So Much Text.



Offline faizan12345

  • Street Thug
  • *
  • Posts: 22
  • VV Developer
    • View Profile
Re: Spawn problems?
« Reply #12 on: February 14, 2012, 06:35:51 pm »
Quote
World Bounds somehow you changed?

Code: [Select]

SetWorldBounds(Float:x_max,Float:x_min,Float:y_max,Float:y_min);


For total map need to be this:

Code: [Select]

SetWorldBounds(5000.0,-5000.0,5000.0,-5000.0);


Not working again player jumping and my Player statrt pos crash

Offline Jay

  • Street Thug
  • *
  • Posts: 12
  • Please don't criticize me. . . Scripting 4 Free
    • View Profile
    • Real Movie's
Re: Spawn problems?
« Reply #13 on: February 14, 2012, 06:40:31 pm »
Quote
World Bounds somehow you changed?

Code: [Select]

SetWorldBounds(Float:x_max,Float:x_min,Float:y_max,Float:y_min);


For total map need to be this:

Code: [Select]

SetWorldBounds(5000.0,-5000.0,5000.0,-5000.0);


Not working again player jumping and my Player statrt pos crash
[pawn]
public OnPlayerConnect(playerid)
{
   SetWaterLevel(6.0);
   SetGamespeed(100);
   SetWorldTime(7);
   SetGravity(100);
   GetPlayerName(playerid,jPlr[playerid],MAX_PLAYER_NAME);
       return 1;
}
[/pawn]

Offline faizan12345

  • Street Thug
  • *
  • Posts: 22
  • VV Developer
    • View Profile
Re: Spawn problems?
« Reply #14 on: February 15, 2012, 07:07:55 am »
Quote
public OnPlayerConnect(playerid)
{
   SetWaterLevel(6.0);
   SetGamespeed(100);
   SetWorldTime(7);
   SetGravity(100);
   GetPlayerName(playerid,jPlr[playerid],MAX_PLAYER_NAME);
       return 1;
}

Not working at all... :'( :(