[Ajuda] Problema com dialog
#1

Estou com o problema com dialog de escolher equipe no gamemode tdm.

Eu troquei o modo de escolher a equipe de AddPlayerClass para escolha por Dialog
sу que quando o player morre, ao invez de spawnar normal, abre o dialog de escolher equipe, alguem pode me ajudar?

PHP код:
//===========Gangs
new policia[] = {280,281,282,283,284};
new 
Grove[] = {270,269,105,106,107};
new 
Yakusa[] = {120,121,122,123,294};
new 
LCN[] = {272,126,125,124};
new 
Motoqueiro[] = {100,247,248,254}; 
PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    
ShowPlayerDialog(playeridDIALOG_GANGSDIALOG_STYLE_LIST"Escolha sua equipe""{345ACF}- Policia\n{2EAD15}- Grove Street\n{F5E618}- Yakusa\n{FFFFFF}- LCN\n{F00A21}- Motoqueiro""Spawn""");

E isso й em public OnDialogResponse

PHP код:
        case DIALOG_GANGS:
        {
            if(!
response) return 0;
            else
            {
                if(
listitem == 0)
                {
                
SetSpawnInfo(playerid0policia[random(3)], 1574.1970,-1695.8732,6.2188,183.9633,0,0,0,0,0,);
                
SetPlayerColor(playerid0x4169E199);
                
SetPlayerTeam(playerid0);
                }
                if(
listitem == 1)
                {
                
SetSpawnInfo(playerid1Grove[random(3)], 2495.2100,-1684.3300,13.5155,0.1000,0,0,0,0,0,);
                
SetPlayerColor(playerid0x2EAD15FF);
                
SetPlayerTeam(playerid1);
                }
                if(
listitem == 2)
                {
                
SetSpawnInfo(playerid2Yakusa[random(3)], 2179.9097,-2256.3252,14.7734,311.9376,0,0,0,0,0,);
                
SetPlayerColor(playerid0xF0E007FF);
                
SetPlayerTeam(playerid2);
                }
                if(
listitem == 3)
                {
                
SetSpawnInfo(playerid3LCN[random(3)], 1265.7200,-2048.1599,59.2666,0.1000,0,0,0,0,0,);
                
SetPlayerColor(playerid0xFFFFFFFF);
                
SetPlayerTeam(playerid3);
                }
                if(
listitem == 4)
                {
                
SetSpawnInfo(playerid4Motoqueiro[random(3)], 1679.3274,-2112.5862,13.5469,270.7365,0,0,0,0,0,);
                
SetPlayerColor(playerid0xF00A21FF);
                
SetPlayerTeam(playerid4);
                }
                
SpawnPlayer(playerid);
            }
        } 
Reply
#2

Tenta adicionar AddPlayerClass e deixar o dialog la
Reply
#3

Quote:
Originally Posted by HelderPT
Посмотреть сообщение
Tenta adicionar AddPlayerClass e deixar o dialog la
Testei, mas nгo й isso.
Reply
#4

Provavelmente vocк tб mostrando o dialog na OnPlayerSpawn, ela й chamada toda vez que o player spawna/respawna, se eu fosse vocк usaria o dialog na OnPlayerRequestClass. Caso esse nгo seja o caso, poste o cуdigo da OnPlayerDeath.
Reply
#5

Quote:
Originally Posted by n0minal
Посмотреть сообщение
Provavelmente vocк tб mostrando o dialog na OnPlayerSpawn, ela й chamada toda vez que o player spawna/respawna, se eu fosse vocк usaria o dialog na OnPlayerRequestClass. Caso esse nгo seja o caso, poste o cуdigo da OnPlayerDeath.
O dialog jб estб na OnPlayerRequestClass

Essa й a OnPlayerSpawn

PHP код:
public OnPlayerSpawn(playerid)
{
    
Spawned[playerid] = 1;
    
PlayerInfo[playerid][pMute] = 0;
    
PlayerPlaySound(playerid,1063,0.0,0.0,0.0);
    
PlayerPlaySound(playerid,30802,0.0,0.0,0.0);
//    SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
    
if(GetPlayerScore(playerid) >= && GetPlayerScore(playerid) <= 30){
        
GivePlayerWeapon(playerid24500);
    }
       if(
GetPlayerScore(playerid) >= 30 && GetPlayerScore(playerid) <= 80){
        
GivePlayerWeapon(playerid24500);
        
GivePlayerWeapon(playerid25500);
    }
       if(
GetPlayerScore(playerid) >= 80 && GetPlayerScore(playerid) <= 150){
        
GivePlayerWeapon(playerid24500);
        
GivePlayerWeapon(playerid25500);
        
GivePlayerWeapon(playerid29500);
    }
       if(
GetPlayerScore(playerid) >= 150 && GetPlayerScore(playerid) <= 230){
        
GivePlayerWeapon(playerid24500);
        
GivePlayerWeapon(playerid25500);
        
GivePlayerWeapon(playerid29500);
    }
       if(
GetPlayerScore(playerid) >= 230 && GetPlayerScore(playerid) <= 320){
        
GivePlayerWeapon(playerid24500);
        
GivePlayerWeapon(playerid25500);
        
GivePlayerWeapon(playerid29500);
        
GivePlayerWeapon(playerid301500);
        
SetPlayerArmour(playerid20);
    }
       if(
GetPlayerScore(playerid) >= 320 && GetPlayerScore(playerid) <= 450){
        
GivePlayerWeapon(playerid24500);
        
GivePlayerWeapon(playerid25500);
        
GivePlayerWeapon(playerid29500);
        
GivePlayerWeapon(playerid311500);
        
SetPlayerArmour(playerid20);
    }
       if(
GetPlayerScore(playerid) >= 450 && GetPlayerScore(playerid) <= 700){
        
GivePlayerWeapon(playerid24500);
        
GivePlayerWeapon(playerid27500);
        
GivePlayerWeapon(playerid29500);
        
GivePlayerWeapon(playerid311500);
        
SetPlayerArmour(playerid20);
    }
       if(
GetPlayerScore(playerid) >= 700 && GetPlayerScore(playerid) <= 1000){
        
GivePlayerWeapon(playerid24500);
        
GivePlayerWeapon(playerid27500);
        
GivePlayerWeapon(playerid29500);
        
GivePlayerWeapon(playerid311500);
        
SetPlayerArmour(playerid60);
    }
       if(
GetPlayerScore(playerid) >= 1000 && GetPlayerScore(playerid) <= 1337){
        
GivePlayerWeapon(playerid24500);
        
GivePlayerWeapon(playerid27500);
        
GivePlayerWeapon(playerid29500);
        
GivePlayerWeapon(playerid3490);
        
GivePlayerWeapon(playerid311500);
        
SetPlayerArmour(playerid60);
    }
       if(
GetPlayerScore(playerid) >= 1337 && GetPlayerScore(playerid) <= 9999999){
        
GivePlayerWeapon(playerid24500);
        
GivePlayerWeapon(playerid27500);
        
GivePlayerWeapon(playerid29500);
        
GivePlayerWeapon(playerid3490);
        
GivePlayerWeapon(playerid311500);
        
SetPlayerArmour(playerid100);
        
GivePlayerWeapon(playerid375);
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)