SA-MP Forums Archive
Auto Spawn. - 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: Auto Spawn. (/showthread.php?tid=192579)



Auto Spawn. - BJaxx - 23.11.2010

I've been tinkering with this for a few hours.
I want it to be so when you log in, you automatically spawn as id 29, in and at coords
-2868.3137,471.6636,4.8773,92.8720 with no weapons, either.

I know I have to use "SetSpawn(playerid)" because that's what SA:MP wiki said to do.
I've tried putting it in:

OnGameModeInit() - Didn't work because there's no "playerid" thing in there.
OnPlayerConnect - For some reason kept taking me to the character selection.
OnPlayerRequestClass - Didn't work as well.

I also tried using SetSpawnInfo (or whatever it is, I don't quite remember), in those, and it didn't work.

It HAS to be something simple, I can't imagine it being overly complicated.



Thannkk you. ^^


Re: Auto Spawn. - [L3th4l] - 23.11.2010

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerPos(playerid, -2868.3137,471.6636,4.8773);
    SetPlayerSkin(playerid, 29);
    return 1;
}



Re: Auto Spawn. - BJaxx - 23.11.2010

That's the half of the problem I already knew. :P
I need help with the SpawnPlayer, for some reason it's not Spawning
them like it should be..Or as SA:MP wiki says it should be.
The wiki said it should force spawn the player. It's still showing the

[CHARACTER HERE]
<- -> SPAWN

Thing, I want that gone, I want it to be straight into the game, you spawn, automatically. No,
"[CHARACTER HERE]
<- -> SPAWN"

thing. :]


Re: Auto Spawn. - Kitten - 23.11.2010

i think this is what u needed
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetTimer("Wooo",2000,false);// 2 seconds it will spawn u
    return 1;
}
forward Wooo(playerid);
public Wooo(playerid)
{
    SpawnPlayer(playerid);
    SetPlayerPos(playerid, -2868.3137,471.6636,4.8773);
    SetPlayerSkin(playerid, 29);
    return 1;
}



Re: Auto Spawn. - BJaxx - 23.11.2010

AH! There we go, thank you Kitten.
That's exactly what I needed.


Re: Auto Spawn. - Kitten - 23.11.2010

Quote:
Originally Posted by BJaxx
Посмотреть сообщение
AH! There we go, thank you Kitten.
That's exactly what I needed.
Glad i helped


Re: Auto Spawn. - BJaxx - 23.11.2010

New question. ;]

My Pickup. I have a clothes (the little blue shirt :]) pickup next to a shed.
The pickup is supposed to put you into class selection, to pick your skin you
want to use.

I have the location and all perfectly set up. However, when I go into it, it fudges up.
Only gives me the 'SendClientMessage'
Even though it's set up as so:
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == Clothes)SendClientMessage(playerid,COLOR_YELLOW, "Pick your skin and select Spawn.");
	ForceClassSelection(playerid);
	return 1;
}
If I can, I'd like to make it so it doesn't have to kill you. I've made a /class command before that kills you, and lets you select your class. But, again, I'd like to not have to kill them, if possible.


Re: Auto Spawn. - Kitten - 23.11.2010

Quote:
Originally Posted by BJaxx
Посмотреть сообщение
New question. ;]

My Pickup. I have a clothes (the little blue shirt :]) pickup next to a shed.
The pickup is supposed to put you into class selection, to pick your skin you
want to use.

I have the location and all perfectly set up. However, when I go into it, it fudges up.
Only gives me the 'SendClientMessage'
Even though it's set up as so:
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(pickupid == Clothes)SendClientMessage(playerid,COLOR_YELLOW, "Pick your skin and select Spawn.");
	ForceClassSelection(playerid);
	return 1;
}
If I can, I'd like to make it so it doesn't have to kill you. I've made a /class command before that kills you, and lets you select your class. But, again, I'd like to not have to kill them, if possible.
I dont think there is a way to do it without killing you so u can do
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == Clothes)SendClientMessage(playerid,COLOR_YELLOW, "Pick your skin and select Spawn.");
        SetPlayerHealth(playerid,0);
    ForceClassSelection(playerid);
    return 1;
}
EDIT: :O

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == Clothes) return /* i think idk =P*/ SendClientMessage(playerid,COLOR_YELLOW, "Pick your skin and select Spawn.");
        {    
             SetPlayerHealth(playerid,0);
         ForceClassSelection(playerid);
    }
        return 1;
}



Re: Auto Spawn. - BJaxx - 23.11.2010

Yeah, I figured I'd have to do that.

Anyways, thanks again. ^^