[Ajuda] Spawnar Cidade diferente
#1

Bom Dia rapaziada, tudo bem?

Rapaziada estou montando um SetSpawn, ou seja quando player Registrar/Logar ele vai spawnar na Cidade que o mesmo escolheu.
Segue meu Cуdigo:

PHP код:
SetPlayerSpawn(playerid)
{
    new 
file[50];
    
format(filesizeof(file), PASTA_CONTASPlayerName(playerid));
    
PlayerInfo[playerid][pSpawnCity] = DOF2_GetInt(file"SpawnCity");
    
PlayerInfo[playerid][pSpawnOrg] = DOF2_GetInt(file"SpawnOrg");
    
CarregarConta(playerid);
    if(
PlayerInfo[playerid][pSpawnCity] == 1)
    {
        if(
PlayerInfo[playerid][pSpawnOrg] == 1)
        {
            
SpawnPlayer(playerid);
        }
    }
    else
    {
        if(
PlayerInfo[playerid][pSpawnCity] == 2)
        {
            if(
PlayerInfo[playerid][pSpawnOrg] == 2)
            {
                
SpawnPlayer(playerid);
                
SetPlayerPos(playerid,  -2718.1245,-317.0169,7.8438);
            }
        }
    }

Sou novatгo e estou aprendendo, o problema й que nгo funcionou, independente da cidade escolhida no tutorial ele ainda spawn num lugar sу.
Como fazer isso dar certo?

Obrigado a todos desde jб.
Atenciosamente,
Matheus Dorado
Reply
#2

Nao sou o mais indicado, ate pq nem cheguei nessa parte, mas imagino que voce deve fazer mais ou menos assim, criar um "id" para cada cidade, exemplo , 1 LS ,2 SF;

pawn Код:
if(PlayerInfo[playerid][pSpawnCity] == 1)
{
if(PlayerInfo[playerid][pSpawnOrg] ==0) // " 0 seria sem org
{  
SetPlayerPos(playerid, CordLS);
}
}
if(PlayerInfo[playerid][pSpawnCity] == 2)
{
if(PlayerInfo[playerid][pSpawnOrg] ==0) // " 0 seria sem org
{  
SetPlayerPos(playerid, CordSF);
}
}
   (
mas com certeza vao te ajudar de uma forma melhor.
Reply
#3

Quote:
Originally Posted by johntrybescripter
Посмотреть сообщение
Nao sou o mais indicado, ate pq nem cheguei nessa parte, mas imagino que voce deve fazer mais ou menos assim, criar um "id" para cada cidade, exemplo , 1 LS ,2 SF;

pawn Код:
if(PlayerInfo[playerid][pSpawnCity] == 1)
{
if(PlayerInfo[playerid][pSpawnOrg] ==0) // " 0 seria sem org
{  
SetPlayerPos(playerid, CordLS);
}
}
if(PlayerInfo[playerid][pSpawnCity] == 2)
{
if(PlayerInfo[playerid][pSpawnOrg] ==0) // " 0 seria sem org
{  
SetPlayerPos(playerid, CordSF);
}
}
   (
mas com certeza vao te ajudar de uma forma melhor.
Vlw Parceiro jб consegui.
Obrigado Pessoal abraзo e atй a prуxima.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)