SA-MP Forums Archive
[Ajuda] dialog de spawn no ppc - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] dialog de spawn no ppc (/showthread.php?tid=539659)



dialog de spawn no ppc - Sodom - 29.09.2014

Estou com uma dificuldade, como inserir uma dialog depois de escolher a classe para escolher o spawn??

alguйm pode me ajudar?
grato.


Re: dialog de spawn no ppc - ExPLORE - 29.09.2014

adiciona return 0; no final da case da classe como ta o exemplo ea sim vai seguindo nas outras classes
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    new Index, Float:x, Float:y, Float:z, Float:Angle, Name[24], Msg[128];

    // Get the player's name
    GetPlayerName(playerid, Name, sizeof(Name));

    // Choose a random spawnlocation based on the player's class
    switch (APlayerData[playerid][PlayerClass])
    {
        case ClassTruckDriver:
        {
            Index = random(sizeof(ASpawnLocationsTrucker)); // Get a random array-index to chose a random spawnlocation
            x = ASpawnLocationsTrucker[Index][SpawnX]; // Get the X-position for the spawnlocation
            y = ASpawnLocationsTrucker[Index][SpawnY]; // Get the Y-position for the spawnlocation
            z = ASpawnLocationsTrucker[Index][SpawnZ]; // Get the Z-position for the spawnlocation
            Angle = ASpawnLocationsTrucker[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
            format(Msg, 128, "o player tal entrou como tal", Name);
            SendClientMessageToAll(-1, Msg);
            ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Resgate Caminhoneiro:", "Fallen Tree Depot\r\nFlint Trucking Depot\r\nLVA Freight Depot\r\nDoherty Depot\r\nEl Corona Depot\r\nLas Payasdas Depot\r\n\nShady Creek Depot", "Spawn", "Cancela");
            return 0;//adiciona return 0;
        }



Re: dialog de spawn no ppc - Sodom - 29.09.2014

Quote:
Originally Posted by ExPLORE
Посмотреть сообщение
adiciona return 0; no final da case da classe como ta o exemplo ea sim vai seguindo nas outras classes
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    new Index, Float:x, Float:y, Float:z, Float:Angle, Name[24], Msg[128];

    // Get the player's name
    GetPlayerName(playerid, Name, sizeof(Name));

    // Choose a random spawnlocation based on the player's class
    switch (APlayerData[playerid][PlayerClass])
    {
        case ClassTruckDriver:
        {
            Index = random(sizeof(ASpawnLocationsTrucker)); // Get a random array-index to chose a random spawnlocation
            x = ASpawnLocationsTrucker[Index][SpawnX]; // Get the X-position for the spawnlocation
            y = ASpawnLocationsTrucker[Index][SpawnY]; // Get the Y-position for the spawnlocation
            z = ASpawnLocationsTrucker[Index][SpawnZ]; // Get the Z-position for the spawnlocation
            Angle = ASpawnLocationsTrucker[Index][SpawnAngle]; // Get the rotation-angle for the spawnlocation
            format(Msg, 128, "o player tal entrou como tal", Name);
            SendClientMessageToAll(-1, Msg);
            ShowPlayerDialog(playerid, DialogRescue, DIALOG_STYLE_LIST, "Resgate Caminhoneiro:", "Fallen Tree Depot\r\nFlint Trucking Depot\r\nLVA Freight Depot\r\nDoherty Depot\r\nEl Corona Depot\r\nLas Payasdas Depot\r\n\nShady Creek Depot", "Spawn", "Cancela");
            return 0;//adiciona return 0;
        }
Obrigado ExPLORE! Funcionou perfeitamente!
+rep