Player won't spawn on register
#1

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

Код:
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.
Reply
#3

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

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

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?
Reply
#6

Bump
Reply
#7

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

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

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

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)