[Ajuda] dialog de spawn no ppc
#1

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

alguйm pode me ajudar?
grato.
Reply
#2

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;
        }
Reply
#3

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)