[DUV]Criar 2 Spawn no RPG
#1

Bom Galera, й o Seguinte, Eu To Codando Um GM RPG Aqui, Ele й em LS, E Eu To Abrindo SF (ORGS, CASAS E TALZ) e Minha Duvida й a Seguinte:

Normalmente Nos GM RPG Vc Nasce em LS, Sу Que Eu Queria Por Assim, Quando o Player Se Registrasse no Jogo, Vinha Um DIALOG E Perguntava: Onde Deseja Nascer? Los Santos San Fierro. e Ai Ele Ficaria Spawnando na Cidade Que Escolheu, Como й Normalmente.

Nao precisa Ser Em Dialog Box, Pode Ser Por Comando Tambem.

Desde Jб Agradeзo.
Reply
#2

pawn Код:
#define nascimento 111
pawn Код:
ShowPlayerDialog(playerid, nascimento, DIALOG_STYLE_MSGBOX, "Selecione onde vocк deseja nascer:", "Los Santos", "San Fierro"
pawn Код:
if (dialogid == nascimento)
{
    if (response)
    {
        SetPlayerPos(playerid, x, y, z);
        SendClientMessage(playerid, 0xFFFFFFFF, "Parabйns vocк nasceu em Los Santos!");
    }

    else
    {
        SetPlayerPos(playerid, x, y, z);
        SendClientMessage(playerid, 0xFFFFFFFF, "Parabйns vocк nasceu em San Fierro!");
    }
    return true;
}
Reply
#3

Vlw, Mais Tipo, Onde Ponho Cada Linha? #define й no topo, mais e as outras 2?
Reply
#4

Essa coloca no tutorial, onde quer que apareзa o dialog falando pra selecionar
pawn Код:
ShowPlayerDialog(playerid, nascimento, DIALOG_STYLE_MSGBOX, "Selecione onde vocк deseja nascer:", "Los Santos", "San Fierro"); //O cуdigo do Domozinho estava errado aqui
Essa coloca em:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (dialogid == nascimento)
    {
        if (response)
        {
            SetPlayerPos(playerid, x, y, z);
            SendClientMessage(playerid, 0xFFFFFFFF, "Parabйns vocк nasceu em Los Santos!");
        }
        else
        {
            SetPlayerPos(playerid, x, y, z);
            SendClientMessage(playerid, 0xFFFFFFFF, "Parabйns vocк nasceu em San Fierro!");
        }
        return true;
    }
    return 1;
}
Espero ter ajudado ^^
Reply
#5

pawn Код:
ShowPlayerDialog(playerid, nascimento, DIALOG_STYLE_MSGBOX, "Selecione onde vocк deseja nascer:", "Los Santos", "San Fierro"); //O cуdigo do Domozinho estava errado aqui
Essa coloca em:
[pawn]public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if (dialogid == nascimento)
{
if (response)
{
SetPlayerPos(playerid, x, y, z); //Coordenadas de Spawn em LS
PlayerInfo[playerid][pOrigin] == 1;
SendClientMessage(playerid, 0xFFFFFFFF, "Parabйns vocк nasceu em Los Santos!");
}

else
{
SetPlayerPos(playerid, x, y, z); //Coordenadas de Spawn em SF
PlayerInfo[playerid][pOrigin] == 2;
SendClientMessage(playerid, 0xFFFFFFFF, "Parabйns vocк nasceu em San Fierro!");
}
return true;
}
return 1;
}

Esqueceu disso em public SetPlayerSpawn:

else
{
SetPlayerToTeamColor(playerid);
if(PlayerInfo[playerid][pOrigin] == 1)
{
SetPlayerPos(playerid,x,y,z);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
}
else if(PlayerInfo[playerid][pOrigin] == 2)
{
SetPlayerPos(playerid,x,y,z);
SetPlayerInterior(playerid,0);
PlayerInfo[playerid][pInt] = 0;
}
Ps: Talvez seja pOrigem no seu mas sу trocar
Reply
#6

@Vanderson, isso jб й mais avanзado... O Domozinho mandou uma base, para ter idйia do que fazer ^^
Mesmo assim agora acho que agora o Gabriel conseguirб
Reply
#7

Quote:
Originally Posted by PsyShotter
Посмотреть сообщение
@Vanderson, isso jб й mais avanзado... O Domozinho mandou uma base, para ter idйia do que fazer ^^
Mesmo assim agora acho que agora o Gabriel conseguirб
й, mas talvez ele nгo conseguisse, sу tentei ajudar ^^
Reply
#8

Agora Eu Consgui Por Pra Nascer Em San Fierro Ou Los Santos, Mais Quando Eu Relogo, o Player Continua Nascendo em LS =/
Reply
#9

O que contйm na callback:

pawn Код:
OnPlayerSpawn
?
Reply
#10

Quote:
Originally Posted by Domozinho
Посмотреть сообщение
O que contйm na callback:

pawn Код:
OnPlayerSpawn
?
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) //Checa se o jogador й um NPC.
    {
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname)); //Obtendo o nome do(s) NPC(s).
        if(!strcmp(npcname, "Tio_Xico", true)) //Checando se o nome do NPC й MeuPrimeiroNPC
        {
            SetPlayerSkin(playerid, 94);
            return 1;
        }
        if(!strcmp(npcname, "Policial_Dp", true)) //Checando se o nome do NPC й MeuPrimeiroNPC
        {
            PutPlayerInVehicle(playerid, Random, 0);
            SetPlayerSkin(playerid, 281);
            GivePlayerWeapon(playerid, 30, 200);
            return 1;
        }
    }
    TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date);
    TextDrawShowForPlayer(playerid, TextdrawB);
    TextDrawShowForPlayer(playerid, tGP2[playerid]);

    InitLockDoors(playerid);
    SetPlayerHealth(playerid, 100);
    STDPlayer[playerid] = 0;
    gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
    gGas[playerid] = 1;
    for(new i=0;i<sizeof(Turfs);i++)
    {
        for(new gangid; gangid < MAX_PLAYERS; gangid++)
        {
            if(TurfInfo[i][zMemberDie] == playerid)
            {
                if(PlayerInfo[gangid][pMember] == PlayerInfo[playerid][pMember])
                {
                    if(i == 0){GangZoneFlashForPlayer(gangid, i, TEAM_GROVE_COLOR);}
                    if(i == 1){GangZoneFlashForPlayer(gangid, i, COLOR_YELLOW);}
                    if(i == 2){GangZoneFlashForPlayer(gangid, i, TEAM_BALLAS_COLOR);}
                    if(i == 3){GangZoneFlashForPlayer(gangid, i, TEAM_AZTECAS_COLOR);}
                    if(i == 4){GangZoneFlashForPlayer(gangid, i, TEAM_COMANDO_COLOR);}
                    if(i == 5){GangZoneFlashForPlayer(gangid, i, TEAM_PCC_COLOR);}
                }
                if(i == 0){GangZoneFlashForPlayer(gangid, i, TEAM_GROVE_COLOR);}
                if(i == 1){GangZoneFlashForPlayer(gangid, i, COLOR_YELLOW);}
                if(i == 2){GangZoneFlashForPlayer(gangid, i, TEAM_BALLAS_COLOR);}
                if(i == 3){GangZoneFlashForPlayer(gangid, i, TEAM_AZTECAS_COLOR);}
                if(i == 4){GangZoneFlashForPlayer(gangid, i, TEAM_COMANDO_COLOR);}
                if(i == 5){GangZoneFlashForPlayer(gangid, i, TEAM_PCC_COLOR);}
                TurfInfo[i][zMemberDie] = -1;
            }
        }
    }
    if (gTeam[playerid] == 4) //medic / criminal reset team
    {
        gTeam[playerid] = 3;
    }
    if(gTeam[playerid] == 11 && PlayerInfo[playerid][pLeader] < 1)
    {
        Hospital[playerid] = 0;
        new rand = random(sizeof(CIV));
        PlayerInfo[playerid][pTeam] = 3;
        gTeam[playerid] = 3;
        SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
        PlayerInfo[playerid][pModel] = CIV[rand];
        SpawnPlayer(playerid);
    }
    if(gTeam[playerid] == 5)
    {
        if(PlayerInfo[playerid][pMember] < 1)
        {
            Hospital[playerid] = 0;
            new rand = random(sizeof(CIV));
            PlayerInfo[playerid][pTeam] = 3;
            gTeam[playerid] = 3;
            SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
            PlayerInfo[playerid][pModel] = CIV[rand];
            SpawnPlayer(playerid);
        }
    }
    if(gTeam[playerid] == 10)
    {
        if(PlayerInfo[playerid][pMember] != 8)
        {
            Hospital[playerid] = 0;
            new rand = random(sizeof(CIV));
            PlayerInfo[playerid][pTeam] = 3;
            gTeam[playerid] = 3;
            SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
            PlayerInfo[playerid][pModel] = CIV[rand];
            SpawnPlayer(playerid);
        }
    }
    if(gTeam[playerid] == 2 && PlayerInfo[playerid][pMember] > 3)
    {
        Hospital[playerid] = 0;
        new rand = random(sizeof(CIV));
        PlayerInfo[playerid][pTeam] = 3;
        gTeam[playerid] = 3;
        SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
        PlayerInfo[playerid][pModel] = CIV[rand];
        SpawnPlayer(playerid);
    }
    if(gTeam[playerid] == 3)
    {
        if(PlayerInfo[playerid][pMember] > 0 || PlayerInfo[playerid][pLeader] > 0)
        {
            Hospital[playerid] = 0;
            new model = PlayerInfo[playerid][pChar];
            if(PlayerInfo[playerid][pMember] == 1) { SetSpawnInfo(playerid, 2, model,0.0,0.0,0.0,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 2) { SetSpawnInfo(playerid, 2, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 3) { SetSpawnInfo(playerid, 2, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 4) { SetSpawnInfo(playerid, 1, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 5) { SetSpawnInfo(playerid, 5, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 6) { SetSpawnInfo(playerid, 5, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 8) { SetSpawnInfo(playerid, 10, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10; gTeam[playerid] = 10; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 9) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 7) { SetSpawnInfo(playerid, 2, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 11) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 16) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 12) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 13) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 14) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 14; gTeam[playerid] = 14; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 10) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 18) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 19) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 20) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 21) { SetSpawnInfo(playerid, 2, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 21; gTeam[playerid] = 21; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pMember] == 22) { SetSpawnInfo(playerid, 12, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 22; gTeam[playerid] = 22; PlayerInfo[playerid][pModel] = model; }
       

            else if(PlayerInfo[playerid][pLeader] == 1) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 2) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 3) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 4) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 5) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 6) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 7) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 8) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 9) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 11) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 14) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 16) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 16; gTeam[playerid] = 16; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 12) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 13) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 7; gTeam[playerid] = 7; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 10) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 14) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 18) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 19) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 20) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 21) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            else if(PlayerInfo[playerid][pLeader] == 22) { SetSpawnInfo(playerid, 11, model,1446.3839,-2287.1284,13.5469,0,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
            //SetSpawnInfo(playerid, team, model,0.0,0.0,0.0,0,0,0,0,0,0,0);
            SpawnPlayer(playerid);
        }
    }
    if(PlayerInfo[playerid][pChar] > 0) { SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); }
    else { SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); }
    SetPlayerWeapons(playerid);
    SetPlayerSpawn(playerid);
    SetPlayerToTeamColor(playerid);
    PlayerFixRadio(playerid);
    for(new i = 0; i < sizeof(Turfs); i++)
    {
        GangZoneShowForAll(i, TurfInfo[i][zColor]);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)