OnPlayerSpawn problem
#1

I spawn middle of nowhere


here is my onplayerspawn

PHP код:
}
public 
OnPlayerSpawn(playerid)
{
      if(
PlayerInfo[playerid][pTut] == 0)
    {
        
PlayerInfo[playerid][pConnectTime] = 0;
        
PlayerInfo[playerid][pBank] = 500;
        
PlayerInfo[playerid][pFight] = 0;
        
PlayerInfo[playerid][pTalk] = 0;
        
PlayerInfo[playerid][pBan] = 0;
        
RegistrationStep[playerid] = 1;
        
Wounded[playerid] = 0;
        
IsUsingAnim[playerid] = 0;
        
SetPlayerCash(playerid,PlayerInfo[playerid][pCash]);
        
TogglePlayerControllable(playerid0);
        
TutorialStage[playerid] = 1;
    }
    if(!
gPlayerAnimLibsPreloaded[playerid])
    {
           
PreloadAnimLib(playerid,"BOMBER");
           
PreloadAnimLib(playerid,"RAPPING");
        
PreloadAnimLib(playerid,"SHOP");
        
PreloadAnimLib(playerid,"RIOT");
           
PreloadAnimLib(playerid,"BEACH");
           
PreloadAnimLib(playerid,"SMOKING");
        
PreloadAnimLib(playerid,"FOOD");
        
PreloadAnimLib(playerid,"ON_LOOKERS");
        
PreloadAnimLib(playerid,"DEALER");
        
PreloadAnimLib(playerid,"CRACK");
        
PreloadAnimLib(playerid,"BEACH");
        
PreloadAnimLib(playerid,"MISC");
        
PreloadAnimLib(playerid,"OTB");
        
PreloadAnimLib(playerid,"SWEET");
        
PreloadAnimLib(playerid,"CARRY");
        
PreloadAnimLib(playerid,"COP_AMBIENT");
        
PreloadAnimLib(playerid,"PARK");
        
PreloadAnimLib(playerid,"INT_HOUSE");
        
PreloadAnimLib(playerid,"HEIST9");
        
PreloadAnimLib(playerid,"FOOD");
        
PreloadAnimLib(playerid,"PED");
        
PreloadAnimLib(playerid,"GHANDS");
        
PreloadAnimLib(playerid,"FIGHT_D");
        
PreloadAnimLib(playerid,"STRIP");
        
PreloadAnimLib(playerid,"BLOWJOBZ");
        
PreloadAnimLib(playerid,"BSKTBALL");
        
PreloadAnimLib(playerid,"BASEBALL");
        
PreloadAnimLib(playerid,"GRAVEYARD");
        
PreloadAnimLib(playerid,"FAT");
        
PreloadAnimLib(playerid,"GANGS");
        
PreloadAnimLib(playerid,"COLT45");
        
PreloadAnimLib(playerid,"TEC");
        
PreloadAnimLib(playerid,"BOX");
        
PreloadAnimLib(playerid,"SUNBATHE");
        
PreloadAnimLib(playerid,"CAR");
        
PreloadAnimLib(playerid,"BD_Fire");
        
PreloadAnimLib(playerid,"BIKES");
        
gPlayerAnimLibsPreloaded[playerid] = 1;
    }
    if(
gPlayerLogged[playerid])
    {
        
SetPlayerSpawn(playerid);
        
SetPlayerHealth(playerid,100);
    }
    return 
1
Reply
#2

Try
pawn Код:
stock PreloadAnimLib(playerid, animlib[])
    return ApplyAnimation(playerid, animlib, "null", 0.0, 0, 0, 0, 0, 0);
pawn Код:
PreloadAnimLib(playerid, "BOMBER");
    PreloadAnimLib(playerid, "RAPPING");
    PreloadAnimLib(playerid, "SHOP");
    PreloadAnimLib(playerid, "BEACH");
    PreloadAnimLib(playerid, "SMOKING");
    PreloadAnimLib(playerid, "ON_LOOKERS");
    PreloadAnimLib(playerid, "DEALER");
    PreloadAnimLib(playerid, "CRACK");
    PreloadAnimLib(playerid, "CARRY");
    PreloadAnimLib(playerid, "COP_AMBIENT");
    PreloadAnimLib(playerid, "PARK");
    PreloadAnimLib(playerid, "INT_HOUSE");
    PreloadAnimLib(playerid, "FOOD");
    PreloadAnimLib(playerid, "GANGS");
    PreloadAnimLib(playerid, "PED");
    PreloadAnimLib(playerid, "FAT");
etc etc
Reply
#3

Still same.
Reply
#4

You say that you spawn in the middle of nowhere? This place isn't a farm? If so, tell me.
Reply
#5

Quote:
Originally Posted by airplanesimen
Посмотреть сообщение
You say that you spawn in the middle of nowhere? This place isn't a farm? If so, tell me.
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(gPlayerLogged[i])
            {
                UpdateScore();
                new ping = GetPlayerPing(i);
                if (ping > 1050)
                {
                    if (PingCheck[i] == 20)
                    { Kick(i); PingCheck[i] = 0; }
                    if (PingCheck[i] < 20)
                    PingCheck[i]++;
                } if(TutorialStage[i] == 1) {
                    SetPlayerPos(i, 1460.2792,-975.7952,108.1177);
                    SetPlayerCameraPos(i, 1460.2792,-975.7952,108.1177); SetPlayerCameraLookAt(i, 1408.4354,-791.1121,84.7171);
                    ClearScreen(i);
                    SendClientMessage(i, COLOR_ORANGE, "- Introduction -");
                    SendClientMessage(i, COLOR_WHITE, "Welcome to the PRototype Gamning SA:MP Server.");
                    SendClientMessage(i, COLOR_WHITE, "A quick tutorial for all players");
                    SendClientMessage(i, COLOR_ORANGE, "Forum Website:Comming soon");
                    TutorialStage[i] = 2;
                } else if(TutorialStage[i] == 2) {
                    SetPlayerPos(i, 1451.6960,-1679.4750,98.8276);
                    SetPlayerCameraPos(i, 1451.6960,-1679.4750,98.8276); SetPlayerCameraLookAt(i, 1571.5203,-1676.1498,0.1280);
                    ClearScreen(i);
                    SendClientMessage(i, COLOR_ORANGE, "Jobs");
                    SendClientMessage(i, COLOR_WHITE, "Some of the jobs, there are ex. Farmer, Mechanic, Materials Deliver, Detective,");
                    SendClientMessage(i, COLOR_WHITE, "Trucker, Drug Dealer, Arms Dealer.");
                    SendClientMessage(i, COLOR_GRAD2, "Now we are heading on to the basic rules and commands.");
                    TutorialStage[i] = 3;
                } else if(TutorialStage[i] == 3) {
                    gPlayerLogged[i] = 1;
                    SpawnPlayer(i);
                    ClearScreen(i);
                    SendClientMessage(i, COLOR_WHITE, "If you have any questions, use /askq. If anybody are");
                    SendClientMessage(i, COLOR_WHITE, "breaking the rules simply use /report, and to view the");
                    SendClientMessage(i, COLOR_WHITE, "To change your spawn to last leaving use /spawn.");
                    SendClientMessage(i, COLOR_WHITE, " ");
                    SendClientMessage(i, COLOR_ORANGE, "- RG:RP Staff.");
                    TogglePlayerControllable(i, 1);
                    SetCameraBehindPlayer(i);
                    SpawnPlayer(i);
                    SetPlayerSpawn(i);
                    PlayerInfo[i][pCash] = 500;
                    SetPlayerCash(i,PlayerInfo[i][pCash]);
                    PlayerInfo[i][pTut] = 1;
                    TutorialStage[i] = 0;

I spawn right here on last pos on my tutorial.

Код:
SetPlayerPos(i, 1451.6960,-1679.4750,98.8276);
Reply
#6

Now i change a bit, but still wrong spawn, i spawn at LV
Reply
#7

Tell me where you want the spawn to be. I can add the coordinates for you
Reply
#8

I know how to change that but still i not start with this when i spawn frist time

Код:
public OnPlayerSpawn(playerid)
{
      if(PlayerInfo[playerid][pTut] == 0)
    {
        PlayerInfo[playerid][pConnectTime] = 0;
        PlayerInfo[playerid][pBank] = 500;
        PlayerInfo[playerid][pFight] = 0;
        PlayerInfo[playerid][pTalk] = 0;
        PlayerInfo[playerid][pBan] = 0;
        RegistrationStep[playerid] = 1;
        Wounded[playerid] = 0;
        IsUsingAnim[playerid] = 0;
        SetPlayerCash(playerid,PlayerInfo[playerid][pCash]);
        TogglePlayerControllable(playerid, 0);
        TutorialStage[playerid] = 1;
Reply
#9

I still dont understand. So you cant get your player spawned? Is that the problem, or is the problem somthing about the spawn ?
Reply
#10

No, they spawn but everything is wrong ec when they spaw they should spawn with 500 cash but spawn with 0
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)