Spawn Help.
#1

I wanna fix the spawn like when someone spawning if he got pNacija =1 to spawn in different place if he got an pNacija = 2 to spawn in another place, im trying to figure out this:

Here its how it look before:
pawn Код:
// Spawning
        if(PlayerInfo[playerid][pX] == 0 && PlayerInfo[playerid][pY] == 0 && PlayerInfo[playerid][pZ] == 0)
        {
            SetPlayerPos(playerid, 958.9146,-1411.4772,13.3833); // THE SPAWN D
            SetPlayerFacingAngle(playerid, 93.3274);
            SetCameraBehindPlayer(playerid);
            SetPlayerInterior(playerid, 0);
            SetPlayerVirtualWorld(playerid, 0);
        }
        else
        {
            SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
            SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
            SetCameraBehindPlayer(playerid);
            SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
            // HP and Armor
            if(PlayerInfo[playerid][pHealth] <= 0) PlayerInfo[playerid][pHealth] = 1;
            SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
            SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
        }
And here its what im trying to do:
pawn Код:
// Spawning
        if(PlayerInfo[playerid][pX] == 0 && PlayerInfo[playerid][pY] == 0 && PlayerInfo[playerid][pZ] == 0 && SpawnPlayer(playerid))
        {
        else if(PlayerInfo[playerid][pNacija] = 1)
        {
        SetSpawnInfo( playerid, 0, 101, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
        }
       else if(PlayerInfo[playerid][pNacija] = 1)
       }
        SetSpawnInfo( playerid, 0, 102, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
       }
       else
       {
            SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
            SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
            SetCameraBehindPlayer(playerid);
            SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
            // HP and Armor
            if(PlayerInfo[playerid][pHealth] <= 0) PlayerInfo[playerid][pHealth] = 1;
            SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
            SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
        }
     }
Reply
#2

pawn Код:
if(PlayerInfo[playerid][pX] == 0 && PlayerInfo[playerid][pY] == 0 && PlayerInfo[playerid][pZ] == 0 && SpawnPlayer(playerid))
        {
        if(PlayerInfo[playerid][pNacija] == 1)
        {
        SetSpawnInfo( playerid, 0, 101, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
        }
       else if(PlayerInfo[playerid][pNacija] == 2)
       }
        SetSpawnInfo( playerid, 0, 102, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );//CHANGE THE COORDINATES!
       }
}
       else
       {
            SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
            SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
            SetCameraBehindPlayer(playerid);
            SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
            // HP and Armor
            if(PlayerInfo[playerid][pHealth] <= 0) PlayerInfo[playerid][pHealth] = 1;
            SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
            SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
        }
Reply
#3

There its problem:
pawn Код:
(63462) : error 029: invalid expression, assumed zero

There problem its here:
pawn Код:
if(PlayerInfo[playerid][pX] == 0 && PlayerInfo[playerid][pY] == 0 && PlayerInfo[playerid][pZ] == 0 && SpawnPlayer(playerid))
        {
        if(PlayerInfo[playerid][pNacija] == 1)
        {
        SetSpawnInfo( playerid, 0, 101, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
        }
       else if(PlayerInfo[playerid][pNacija] == 2)
       }//HERE PROBLEM<<<<<<<<< THIS SHOULD BE {
        SetSpawnInfo( playerid, 0, 102, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );//CHANGE THE COORDINATES!
       }
       else
       {
            SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
            SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
            SetCameraBehindPlayer(playerid);
            SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
            // HP and Armor
            if(PlayerInfo[playerid][pHealth] <= 0) PlayerInfo[playerid][pHealth] = 1;
            SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
            SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
        }
     }
Reply
#4

pawn Код:
if(PlayerInfo[playerid][pX] == 0 && PlayerInfo[playerid][pY] == 0 && PlayerInfo[playerid][pZ] == 0 && SpawnPlayer(playerid))
        {
        if(PlayerInfo[playerid][pNacija] == 1)
        {
        SetSpawnInfo( playerid, 0, 101, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
        }
       else if(PlayerInfo[playerid][pNacija] == 2)
       {
        SetSpawnInfo( playerid, 0, 102, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );//CHANGE THE COORDINATES!
       }
}
       else
       {
            SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
            SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
            SetCameraBehindPlayer(playerid);
            SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
            // HP and Armor
            if(PlayerInfo[playerid][pHealth] <= 0) PlayerInfo[playerid][pHealth] = 1;
            SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
            SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
        }
Yeah I didn't notice it lol
Reply
#5

But there its problem now when the char spawning its fucked I mean it moving like crazy and then after 20 sec it fixes.

Its look like this now:
pawn Код:
// Spawning
        if(PlayerInfo[playerid][pX] == 0 && PlayerInfo[playerid][pY] == 0 && PlayerInfo[playerid][pZ] == 0 && SpawnPlayer(playerid))
        {
        if(PlayerInfo[playerid][pNacija] == 1)
        {
        SetSpawnInfo( playerid, 0, 101, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
        }
        else if(PlayerInfo[playerid][pNacija] == 2)
        {
        SetSpawnInfo( playerid, 0, 102, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );//CHANGE THE COORDINATES!
       }
       else
       {
            SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
            SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
            SetCameraBehindPlayer(playerid);
            SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
            // HP and Armor
            if(PlayerInfo[playerid][pHealth] <= 0) PlayerInfo[playerid][pHealth] = 1;
            SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
            SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
        }
      }
}
Reply
#6

dude your pawn code is not similar to mine, check the last code And you will find out what I edited
Reply
#7

Quote:
Originally Posted by Eth
Посмотреть сообщение
dude your pawn code is not similar to mine, check the last code And you will find out what I edited
Yea i add that code and its bad because the player its moving like crazy and giving me weapons then after 10-15sec its fixed, why its that ?

Here its an video look the mouse courser:
https://www.youtube.com/watch?v=hDgUaxaggw4
Reply
#8

Bump anyone?
Reply
#9

I tried to figure out in this way as using SetPlayerPos without using SetSpawnInfo but the second location not work for nacija=2 ? When i use the setspawninfo there bugs look the video..
pawn Код:
if(PlayerInfo[playerid][pX] == 0 && PlayerInfo[playerid][pY] == 0 && PlayerInfo[playerid][pZ] == 0 && SpawnPlayer(playerid))
        {
        if(PlayerInfo[playerid][pNacija] == 1)
        {
           SetPlayerPos(playerid, 1958.2618,-2190.2368,13.5469); // THE SPAWN A
        }
       else if(PlayerInfo[playerid][pNacija] == 2)
       {
          SetPlayerPos(playerid, 691.7090,-443.4517,16.3437); // THE SPAWN D
           //SetSpawnInfo(playerid, 0, 44, 691.7090, -443.4517, 16.3437, 269.15, 26, 36, 28, 150, 0, 0 );

       }
}
       else
       {
            SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
            SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
            SetCameraBehindPlayer(playerid);
            SetPlayerPos(playerid, PlayerInfo[playerid][pX], PlayerInfo[playerid][pY], PlayerInfo[playerid][pZ]);
            // HP and Armor
            if(PlayerInfo[playerid][pHealth] <= 0) PlayerInfo[playerid][pHealth] = 1;
            SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
            SetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]);
        }
Reply
#10

Still have this bugs..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)