SA-MP Forums Archive
Spawn immediatly after connection - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Spawn immediatly after connection (/showthread.php?tid=185900)



Spawn immediatly after connection - Amator - 26.10.2010

Hey!

I would like to know how to spawn a player immediatly after he connected. No command for /spawn, no login or register just when you connect you spawn.

THank you


Re: Spawn immediatly after connection - Sascha - 26.10.2010

Код:
OnPlayerConnect(playerid)
{
  SpawnPlayer(playerid);
}
"This forum requires that you wait 120 seconds between posts. Please try again in 60 seconds."
"This forum requires that you wait 120 seconds between posts. Please try again in 30 seconds."
"This forum requires that you wait 120 seconds between posts. Please try again in 15 seconds."
man this sux....


Re : Spawn immediatly after connection - Amator - 26.10.2010

^^ thank you


Re : Spawn immediatly after connection - Amator - 26.10.2010

Hm... I took a new script to test it but it does not work... What I have to do to spawn ? I didn't load any FS


Re: Spawn immediatly after connection - Sascha - 26.10.2010

hm..
try to move the code I wrote to
"public OnPlayerRequestClass(playerid, classid)"

then it should work :P...


Re: Spawn immediatly after connection - Jantjuh - 26.10.2010

Quote:
Originally Posted by Sascha
Посмотреть сообщение
hm..
try to move the code I wrote to
"public OnPlayerRequestClass(playerid, classid)"

then it should work :P...
like:

Код:
OnPlayerRequestClass(playerid, classid)
{
  SpawnPlayer(playerid);
}
just to make it more clear ^.^


Re : Spawn immediatly after connection - Amator - 26.10.2010

Thank you for your helpful detail Jantjuh but it still not work. Remember I took a new script to do it. Maybe there's a problem with it?

Thank you both of you


Re: Spawn immediatly after connection - Sascha - 26.10.2010

normally there should be any problem with a new script...
hm...I guess it's because the "game" is still loading or so..
maybe try it with a timer which spawns the player after something like 5-10 seconds after connecting (maybe longer... find out how much time is between the "connected" and the loading of the class selection and make the timer 5 seconds or so longer..)


Re : Spawn immediatly after connection - Amator - 26.10.2010

Yeah maybe...so...How I can add a timer before automatic spawn?? ^^


Re: Spawn immediatly after connection - Sascha - 26.10.2010

Код:
forward AutoSpawn(playerid);

public OnPlayerConnect(playerid)
{
  SetTimerEx("AutoSpawn", 20000, false, "i", playerid); //20 seconds - change the time if necessary
  return 1;
}

public AutoSpawn(playerid)
{
  SpawnPlayer(playerid);
  return 1;
}



Re : Spawn immediatly after connection - Amator - 26.10.2010

Okay thank you it work but players are always able to click on spawn button ... Ho to delete it? please I think it's my last question ^^


Re : Spawn immediatly after connection - Amator - 26.10.2010

Thank it works! But ^^ there is still the "spawn" button. How can I delete it to prevent player to use it?


Re : Spawn immediatly after connection - Amator - 26.10.2010

Quote:
Originally Posted by Amator
Посмотреть сообщение
Thank it works! But ^^ there is still the "spawn" button. How can I delete it to prevent player to use it?
Ho sorry for triple


Re: Spawn immediatly after connection - Ironboy500[TW] - 26.10.2010

You can't remove |Spawn| and |<<| |>>| buttons.


Re: Spawn immediatly after connection - Amator - 26.10.2010

Okay thanks