OnPlayerSpawn issue.
#6

pawn Код:
SetPlayerPos(playerid, 00,2136.7041,33.7916,26.4215,265.5875,0,0,0,0,0,0);
This is wrong. SetPlayerPos uses '4' parameters, you are using 12...

You are confusing SetPlayerPos with SetSpawnInfo.
SetPlayerPos expects these parameters:
Код:
SetPlayerPos(playerid, Float:x, Float:y, Float:z)
SetSpawnInfo expects these parameters:
Код:
SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
If we deconstruct this line, we can determine what values we want...
Your first parameter would be the 'playerid' parameter, so that is fine how it is.

The next parameter was '00', which I am going to assume was a typo of '0, 0'.
These parameters will represent 'team' and 'skin'.

Then you have your x, y, z and angle parameters, and so on...
Код:
playerid = playerid
team = 0
skin = 0
Float:x = 2136.7041
Float:y = 33.7916
Float:z = 26.4215
Float:Angle = 265.5875
weapon1 = 0
weapon1_ammo = 0
weapon2 = 0
weapon2_ammo = 0
weapon3 = 0
weapon3_ammo = 0
Thus the correct code being:
pawn Код:
SetSpawnInfo(playerid, 0, 0, 2136.7041, 33.7916, 26.4215, 265.5875, 0, 0, 0, 0, 0, 0);
Replace 'SetPlayerPos' with that line.

EDIT:
Also, SetSpawnInfo should be under OnPlayerConnect, not OnPlayerSpawn.

pawn Код:
public OnPlayerConnect(playerid)
{
    SetSpawnInfo(playerid, 0, 0, 2136.7041, 33.7916, 26.4215, 265.5875, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    GivePlayerMoney(playerid, 1000);
    SendClientMessage(playerid, COLOR_YELLOW, "You have been given $1000 to start off with. Spend it wisely!");
    return 1;
}
Reply


Messages In This Thread
OnPlayerSpawn issue. - by mkmk - 26.10.2014, 19:08
Re: OnPlayerSpawn issue. - by Sawalha - 26.10.2014, 19:12
Re: OnPlayerSpawn issue. - by mkmk - 26.10.2014, 19:37
Re: OnPlayerSpawn issue. - by Abagail - 26.10.2014, 19:49
Re: OnPlayerSpawn issue. - by mkmk - 26.10.2014, 19:51
Re: OnPlayerSpawn issue. - by Threshold - 26.10.2014, 23:05
Respuesta: OnPlayerSpawn issue. - by !R1Ch@rD! - 26.10.2014, 23:11

Forum Jump:


Users browsing this thread: 1 Guest(s)