Szerző Téma: Spawn  (Megtekintve 635 alkalommal)

Spawn
« Dátum: 2012. Augusztus 08. - 03:10:33 »
0 Show voters
Sziasztok
Olyan kérdésem lenne,hogy olyat hogy tudok csinálni hogy ha egy játékos felcsatlakozik a szerverre és választ skint ne csak úgy randomra dobálja le a playereket..Ha nem ki lehetne pl választani hogy most Los Santosba dobjon,vagy San Fierraba..
Ezt hogy lehet megoldani?

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Spawn
« Válasz #1 Dátum: 2012. Augusztus 08. - 03:41:09 »
+1 Show voters
Ez az eggyik alap gm-be benne van, még kamera mozgással is, de ha dialogba szeretnéd akkor:
 
#include <a_samp>
#define SelectCity 5000
public
OnPlayerRequestSpawn(playerid) {
        ShowPlayerDialog(playerid, SelectCity, DIALOG_STYLE_LIST, \"Spawn kiválasztása\", \"Los Santos\\nSan Fierro\\nLas Venturas\\nstb...\\n\", \"Go\", \"Bezár\"       
        return 1;
}
public
OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
if(dialogid == SelectCity)
{
        if(response)
        {
                if(listitem == 0)  SetPlayerPos(playerid, x, y, z);
                if(listitem == 1)  SetPlayerPos(playerid, x, y, z);
                if(listitem == 2)  SetPlayerPos(playerid, x, y, z);
                //if(listitem == 3)  SetPlayerPos(playerid, x, y, z);
        }
}
        return 1;
}

Spawn
« Válasz #2 Dátum: 2012. Augusztus 08. - 10:25:10 »
0 Show voters
Ez az eggyik alap gm-be benne van, még kamera mozgással is, de ha dialogba szeretnéd akkor:

    #include <a_samp>
    #define SelectCity 5000
     
    public
            OnPlayerRequestSpawn(playerid) {
            ShowPlayerDialog(playerid, SelectCity, DIALOG_STYLE_LIST, \"Spawn kiválasztása\", \"Los Santos\\nSan Fierro\\nLas Venturas\\nstb...\\n\", \"Go\", \"Bezár\"       
            return 1;
    }
     
    public
            OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
            if(dialogid == SelectCity)
            {
                    if(response)
                    {
                            if(listitem == 0)  SetPlayerPos(playerid, x, y, z);
                            if(listitem == 1)  SetPlayerPos(playerid, x, y, z);
                            if(listitem == 2)  SetPlayerPos(playerid, x, y, z);
                            //if(listitem == 3)  SetPlayerPos(playerid, x, y, z);
                    }
            }
            return 1;
    }

 
[/quote]
d eneki szerintem uugy kell h elmetse és ne kérdezze le minden spawnál!
« Utoljára szerkesztve: 2012. Augusztus 08. - 11:13:32 írta Benceee »

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Spawn
« Válasz #3 Dátum: 2012. Augusztus 08. - 11:26:31 »
0 Show voters
Nem teszteltem:
 
#include <a_samp>
#define SelectCity 5000
new asd[MAX_PLAYERS];
public OnPlayerRequestSpawn(playerid) {
if(asd[playerid] == 0)
{
ShowPlayerDialog(playerid, SelectCity, DIALOG_STYLE_LIST, \"Spawn kiválasztása\", \"Los Santos\\nSan Fierro\\nLas Venturas\\nstb...\\n\", \"Go\", \"Bezár\");
}
    return 1;
}
public OnPlayerConnect(playerid) return asd[playerid] = 0;
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
if(dialogid == SelectCity)
{
        if(response)
        {
           asd[playerid] = 1;
        if(listitem == 0) SetPlayerPos(playerid, 0, 0, 0);// 0, 0, 0 hjelyére a koordinátákat.
        if(listitem == 1) SetPlayerPos(playerid, 0, 0, 0);// 0, 0, 0 hjelyére a koordinátákat.
        if(listitem == 2) SetPlayerPos(playerid, 0, 0, 0);// 0, 0, 0 hjelyére a koordinátákat.
        //if(listitem == 3) SetPlayerPos(playerid, 0, 0, 0);// 0, 0, 0 hjelyére a koordinátákat.
        }
}
return 1;
}

Spawn
« Válasz #4 Dátum: 2012. Augusztus 08. - 11:34:19 »
+1 Show voters
hat akkor meg szerintem csinalja ugy hogy:
csinalsz egy valtozot:
 

new spawnhely[MAX_PLAYERS];
new file[100];

 
OnPlayerConnect ala:
 

spawnhely[playerid] = 0;

 
A dialog alatt pedig meg oda rakod hogy:
 

                            if(listitem == 0)  SetPlayerPos(playerid, ide), spawnhely[playerid] = 1;
                            if(listitem == 1)  SetPlayerPos(playerid, oda), spawnhely[playerid] = 2;
                            if(listitem == 2)  SetPlayerPos(playerid, amoda), spawnhely[playerid] = 1;

 


if(!dini_Exists(file)) {
dini_Create(file);
dini_IntSet(file, \"SpawnHely\", spawnhely[playerid]);
} else if(dini_Exists(file)) {
spawnhely[playerid] = dini_Int(file, \"SpawnHely\");
}

 
OnPlayerSpawn ala:
 

if(spawnhely[playerid] == 0) //Ha meg nincs neki spawnhelye
ShowPlayerDialog(...)// Spawnivalasztasi Dialog
else if(spawnhely[playerid] == 1)
SetPlayerPos(ide);
else if(spawnhely[playerid == 2)
SetPlayerPos(oda);
else if(spawnhely[playerid] == 3)
SetPlayerPos(mashova);

 
Azthiszem igy :)
De nem tudom.Am boccs flash scak egyidoben irtam veled :P
« Utoljára szerkesztve: 2012. Augusztus 08. - 11:37:25 írta xSkillZ7x »

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Spawn
« Válasz #5 Dátum: 2012. Augusztus 08. - 11:36:04 »
0 Show voters
Nem hinném hogy ez jó, de minek menteni + még ki se választotta akkor mit ment?
Amúgy lemaradt a new file[100];

Spawn
« Válasz #6 Dátum: 2012. Augusztus 08. - 11:38:09 »
0 Show voters
A sorrendet ossze vissza tettem :(.Nah de nekem igy volt.

Nem elérhető Flash

  • 5726
  • (っ◕‿◕)っ
    • Profil megtekintése
Spawn
« Válasz #7 Dátum: 2012. Augusztus 08. - 11:46:47 »
+1 Show voters
new name[MAX_PLAYER_NAME];
GetPlayerName(playeridm name, sizeof name);
De akkor még ez is hiányzik hogy: format(file, sizeof file, \"Mappa/%d\"name);
De szerintem feleslegese lementeni, szóval:
 

Nem teszteltem:
 
#include <a_samp>
#define SelectCity 5000
new asd[MAX_PLAYERS];
public OnPlayerRequestSpawn(playerid) {
if(asd[playerid] == 0)
{
ShowPlayerDialog(playerid, SelectCity, DIALOG_STYLE_LIST, \"Spawn kiválasztása\", \"Los Santos\\nSan Fierro\\nLas Venturas\\nstb...\\n\", \"Go\", \"Bezár\");
}
    return 1;
}
public OnPlayerConnect(playerid) return asd[playerid] = 0;
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
if(dialogid == SelectCity)
{
        if(response)
        {
           asd[playerid] = 1;
        if(listitem == 0) SetPlayerPos(playerid, 0, 0, 0);// 0, 0, 0 hjelyére a koordinátákat.
        if(listitem == 1) SetPlayerPos(playerid, 0, 0, 0);// 0, 0, 0 hjelyére a koordinátákat.
        if(listitem == 2) SetPlayerPos(playerid, 0, 0, 0);// 0, 0, 0 hjelyére a koordinátákat.
        //if(listitem == 3) SetPlayerPos(playerid, 0, 0, 0);// 0, 0, 0 hjelyére a koordinátákat.
        }
}
return 1;
}

 
[/quote]

Spawn
« Válasz #8 Dátum: 2012. Augusztus 08. - 12:57:57 »
0 Show voters
Idézetet írta: Flash date=1344419207\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"25725\" data-ipsquote-contentclass=\"forums_Topic
new name[MAX_PLAYER_NAME];
GetPlayerName(playeridm name, sizeof name);
De akkor még ez is hiányzik hogy: format(file, sizeof file, \"Mappa/%d\"name);
De szerintem feleslegese lementeni, szóval:
 

Nem teszteltem:
 
#include <a_samp>
#define SelectCity 5000
new asd[MAX_PLAYERS];
public OnPlayerRequestSpawn(playerid) {
if(asd[playerid] == 0)
{
ShowPlayerDialog(playerid, SelectCity, DIALOG_STYLE_LIST, \"Spawn kiválasztása\", \"Los Santos\\nSan Fierro\\nLas Venturas\\nstb...\\n\", \"Go\", \"Bezár\");
}
    return 1;
}
public OnPlayerConnect(playerid) return asd[playerid] = 0;
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
if(dialogid == SelectCity)
{
        if(response)
        {
           asd[playerid] = 1;
        if(listitem == 0) SetPlayerPos(playerid, 0, 0, 0);// 0, 0, 0 hjelyére a koordinátákat.
        if(listitem == 1) SetPlayerPos(playerid, 0, 0, 0);// 0, 0, 0 hjelyére a koordinátákat.
        if(listitem == 2) SetPlayerPos(playerid, 0, 0, 0);// 0, 0, 0 hjelyére a koordinátákat.
        //if(listitem == 3) SetPlayerPos(playerid, 0, 0, 0);// 0, 0, 0 hjelyére a koordinátákat.
        }
}
return 1;
}

 

Igen nem kell lementeni :D Köszi!^^
[/quote]

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal