Auto Spawn.
#1

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. ^^
Reply
#2

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

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. :]
Reply
#4

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;
}
Reply
#5

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

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

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.
Reply
#8

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;
}
Reply
#9

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

Anyways, thanks again. ^^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)