Prevent to show SA:MP default class selection at player join.
#1

As title says I want to spawn the player as soon as he join the server.
How to this ?
Reply
#2

pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
    SpawnPlayer(playerid);
    return 1;
}
Reply
#3

AFAIK that doesn't work - you have to delay it on a timer (1 MS, or perhaps even 0 MS).
Reply
#4

Yes it does.

Also ensure that you have created at least one dud player class using AddPlayerClass. Or alternatively you could use SetSpawnInfo.
Reply
#5

Try this (tested):

pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
    SetTimer("SpawnP", 1, false);
    return 1;
}

forward SpawnP(playerid);
public SpawnP(playerid)
{
    SpawnPlayer(playerid);
    return 1;
}
Reply
#6

Wouldn't you need to use SetTimerEx, considering it's player-specific.

You're calling a function that requires a parameter, but you're not providing one

I'd say

pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
    SetTimerEx("SpawnP", 1, false, "i", playerid);
    return 1;
}

forward SpawnP(playerid);
public SpawnP(playerid)
{
    SpawnPlayer(playerid);
    return 1;
}
Reply
#7

Quote:
Originally Posted by Jay_
Посмотреть сообщение
Yes it does.
It doesn't; I just tested it.
Reply
#8

http://pastebin.com/PPWeH67x

Just ran this as a gamemode, worked fine.
Reply
#9

Ah yes that does appear to work, although it doesn't work unless SetSpawnInfo has been used, even if AddPlayerClass is used. This may be rather useful for me - thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)