Player won't spawn on register -
stormchaser206 - 20.01.2014
Here is my code:
http://pastebin.com/9fWw9iXA
So, I go through the tutorial when I register, I hid the spawn button so I automatically spawn. The problem is, that once I'm done with the last part of the tutorial (Timer: "FinalTut"), the camera just stays up in the air and I can't figure out why.
If anyone could check that code and tell me why, it would be greatly appreciated.
Thanks.
Re: Player won't spawn on register -
gahal156 - 20.01.2014
Код:
public Spawn(playerid)
{
if(strcmp(pInfo[playerid][Gender], "Male", true))
{
TogglePlayerSpectating(playerid, 0);
//SetPlayerPos(playerid, -1424.6716, -288.3624, 14.1484);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerSkin(playerid, 295);
pInfo[playerid][Level] = 1;
SetSpawnInfo(playerid, 0, 295, -1424.6716,-288.3624,14.1484, 0.0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
else if(strcmp(pInfo[playerid][Gender], "Female", true))
{
TogglePlayerSpectating(playerid, 0);
//SetPlayerPos(playerid, 1643.0640, -2332.2261, 13.5469);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerSkin(playerid, 93);
pInfo[playerid][Level] = 1;
SetSpawnInfo(playerid, 0, 93, 1643.0640, -2332.2261, 13.5469, 0.0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
return 1;
}
Try that.
Re: Player won't spawn on register -
stormchaser206 - 20.01.2014
Quote:
Originally Posted by gahal156
Код:
public Spawn(playerid)
{
if(strcmp(pInfo[playerid][Gender], "Male", true))
{
TogglePlayerSpectating(playerid, 0);
//SetPlayerPos(playerid, -1424.6716, -288.3624, 14.1484);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerSkin(playerid, 295);
pInfo[playerid][Level] = 1;
SetSpawnInfo(playerid, 0, 295, -1424.6716,-288.3624,14.1484, 0.0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
else if(strcmp(pInfo[playerid][Gender], "Female", true))
{
TogglePlayerSpectating(playerid, 0);
//SetPlayerPos(playerid, 1643.0640, -2332.2261, 13.5469);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerSkin(playerid, 93);
pInfo[playerid][Level] = 1;
SetSpawnInfo(playerid, 0, 93, 1643.0640, -2332.2261, 13.5469, 0.0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
}
return 1;
}
Try that.
|
Didn't work.
Also (not trying to be mean; also this is to everyone), please test your code before giving it.
Re: Player won't spawn on register -
ACI - 20.01.2014
Everyone doesn't have time to test your code, we also do have other work to do. Anyway use OnPlayerSpawn(playerid); instead of SpawnPlayer(playerid);
Edit:
pawn Код:
// Dont do what I said above. Execute your mode with this code.
public OnPlayerSpawn(playerid)
{
SetCameraBehindPlayer(playerid);
return 1;
}
Re: Player won't spawn on register -
stormchaser206 - 20.01.2014
I did that, didn't work. However, I did remove SpawnPlayer (as well as added that), so should I re-add SpawnPlayer to public Spawn?
Re: Player won't spawn on register -
stormchaser206 - 21.01.2014
Bump
Re: Player won't spawn on register -
SchurmanCQC - 21.01.2014
Quote:
Originally Posted by stormchaser206
Also (not trying to be mean; also this is to everyone), please test your code before giving it.
|
You expect us to test code for you? That's the
least you can do while receiving a help service from the community.
Re: Player won't spawn on register -
stormchaser206 - 21.01.2014
Quote:
Originally Posted by ACI
Everyone doesn't have time to test your code, we also do have other work to do. Anyway use OnPlayerSpawn(playerid); instead of SpawnPlayer(playerid);
Edit:
pawn Код:
// Dont do what I said above. Execute your mode with this code. public OnPlayerSpawn(playerid) { SetCameraBehindPlayer(playerid); return 1; }
|
Quote:
Originally Posted by SchurmanCQC
You expect us to test code for you? That's the least you can do while receiving a help service from the community.
|
From the rules:

Read for yourself:
http://forum.sa-mp.com/announcement.php?f=12
Re: Player won't spawn on register -
pyrodojo25 - 21.01.2014
Try this
pawn Код:
public Spawn(playerid)
{
if(!strcmp(pInfo[playerid][Gender], "Male", true))
{
TogglePlayerSpectating(playerid, 0);
SetPlayerPos(playerid, -1424.6716, -288.3624, 14.1484);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerSkin(playerid, 295);
pInfo[playerid][Level] = 1;
}
else if(!strcmp(pInfo[playerid][Gender], "Female", true))
{
TogglePlayerSpectating(playerid, 0);
SetPlayerPos(playerid, 1643.0640, -2332.2261, 13.5469);
SetPlayerInterior(playerid, 0);
SetCameraBehindPlayer(playerid);
SetPlayerSkin(playerid, 93);
pInfo[playerid][Level] = 1;
}
return 1;
}
Re: Player won't spawn on register -
stormchaser206 - 21.01.2014
Quote:
Originally Posted by pyrodojo25
Try this
pawn Код:
public Spawn(playerid) { if(!strcmp(pInfo[playerid][Gender], "Male", true)) { TogglePlayerSpectating(playerid, 0); SetPlayerPos(playerid, -1424.6716, -288.3624, 14.1484); SetPlayerInterior(playerid, 0); SetCameraBehindPlayer(playerid); SetPlayerSkin(playerid, 295); pInfo[playerid][Level] = 1; } else if(!strcmp(pInfo[playerid][Gender], "Female", true)) { TogglePlayerSpectating(playerid, 0); SetPlayerPos(playerid, 1643.0640, -2332.2261, 13.5469); SetPlayerInterior(playerid, 0); SetCameraBehindPlayer(playerid); SetPlayerSkin(playerid, 93); pInfo[playerid][Level] = 1; } return 1; }
|
The only part that didn't work with that is that it does this after the tutorial:

Although, I think it does that every spawn. Because one time, I went back on and spawned, but when I died, that picture happened (and it does that right now after tutorial)