[Ajuda] Comando /ligar 911
#1

Toda vez que uso o comando /ligar 911 = emergencias
pede para mim escolher: Qual serviзo vocк deseja, Polнcia ou Ambulвncia, escolho policia ae aparecer: Ocupado...

PHP код:
    if(strcmp(cmd"/ligar"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_GRAD2"USO: /ligar [nъmero]");
                
SendClientMessage(playeridCOLOR_GRAD2"Ligue 911 para emergкncias.");
                return 
1;
            }
            if(
PlayerInfo[playerid][pMuted] == 1)
            {
                
SendClientMessage(playeridCOLOR_RED"|-Vocк foi mutado por um admin, nгo pode falar-|");
                return 
1;
            }
            if(
PlayerInfo[playerid][pPhone] == 0)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"  Vocк nгo tem um celular !");
                return 
1;
            }
            
GetPlayerName(playeridsendernamesizeof(sendername));
            
format(stringsizeof(string), "%s tirou o celular do bolso."sendername);
            
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            new 
phonenumb strval(tmp);
            if(
phonenumb == 911)
            {
                
SendClientMessage(playeridCOLOR_WHITE"DICA: Vocк pode usar agora T para conversar no celular, digite (/des)ligar para desligar.");
                
SendClientMessage(playeridCOLOR_ALLDEPT"EMERGКNCIA: Qual serviзo vocк deseja, Polнcia ou Ambulвncia");
                
Mobile[playerid] = 911;
                
SetPlayerSpecialAction(playeridSPECIAL_ACTION_USECELLPHONE);
                return 
1;
            }
            if(
phonenumb == PlayerInfo[playerid][pPnumber])
            {
                
SendClientMessage(playeridCOLOR_GRAD2"  Ocupado...");
                return 
1;
            }
            if(
Mobile[playerid] != 255)
            {
                
SendClientMessage(playeridCOLOR_GRAD2"  Vocк jб estб em uma ligaзгo");
                return 
1;
            }
            for(new 
0MAX_PLAYERSi++)
            {
                if(
IsPlayerConnected(i))
                {
                    if(
PlayerInfo[i][pPnumber] == phonenumb && phonenumb != 0)
                    {
                        
giveplayerid i;
                        
Mobile[playerid] = giveplayerid//caller connecting
                        
if(IsPlayerConnected(giveplayerid))
                        {
                            if(
giveplayerid != INVALID_PLAYER_ID)
                            {
                                if(
PhoneOnline[giveplayerid] > 0)
                                {
                                    
SendClientMessage(playeridCOLOR_GREY"   O telefone do jogador estб desligado !");
                                    return 
1;
                                }
                                if (
Mobile[giveplayerid] == 255)
                                {
                                    
format(stringsizeof(string), "Seu celular estб tocando, (/at)ender jogador: %s"sendername);
                                    
SendClientMessage(giveplayeridCOLOR_YELLOWstring);
                                    
GetPlayerName(giveplayeridsendernamesizeof(sendername));
                                    
RingTone[giveplayerid] = 10;
                                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_USECELLPHONE);
                                    
format(stringsizeof(string), "O telefone de %s estб tocando."sendername);
                                    
SendClientMessage(playeridCOLOR_WHITE"DICA: Vocк pode usar agora T para conversar no celular, digite (/des)ligar para desligar.");
                                    
ProxDetector(30.0istringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                    
CellTime[playerid] = 1;
                                    return 
1;
                                }
                            }
                        }
                    }
                }
            }
            
SendClientMessage(playeridCOLOR_GRAD2"  Ocupado...");
        }
        return 
1;
    } 
Era para aparecer isso, ou invez de o Ocupado

PHP код:
        if(Mobile[playerid] == 913)
        {
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_ALLDEPT"EMERGENCIA: Desculpe, nгo estou entendendo");
                return 
0;
            }
            if ((
strcmp("nгo"tmptruestrlen(tmp)) == 0) && (strlen(tmp) == strlen("nгo")))
            {
                new 
turner[MAX_PLAYER_NAME];
                new 
wanted[128];
                
GetPlayerName(playeridturnersizeof(turner));
                
SendClientMessage(playeridCOLOR_DBLUE"Polнcia HQ: Nуs alertamos todas as unidades da бrea.");
                
SendClientMessage(playeridCOLOR_DBLUE"Obrigado por nos relatar este crime.");
                
format(wantedsizeof(wanted), "HQ: Toda as unidades APB: Relato: %s",turner);
                
SendFamilyMessage(1COLOR_DBLUEwanted);
                
format(wantedsizeof(wanted), "HQ: Crime: %s, Suspeito: Desconhecido",PlayerCrime[playerid][pAccusing]);
                
SendFamilyMessage(1COLOR_DBLUEwanted);
                
SendClientMessage(playeridCOLOR_GRAD2"   ");
                
SetPlayerSpecialAction(playeridSPECIAL_ACTION_STOPUSECELLPHONE);
                
Mobile[playerid] = 255;
                return 
0;
            }
            new 
badguy;
            
badguy ReturnUser(tmp);
            if (
IsPlayerConnected(badguy))
            {
                if(
badguy != INVALID_PLAYER_ID)
                {
                    if (
gTeam[badguy] == || gTeam[badguy] == 1)
                    {
                        
SendClientMessage(playeridCOLOR_DBLUE"Polнcia HQ: Vocк terб que contactar os assuntos internos. Esta й uma linha de emergкncia");
                        
Mobile[playerid] = 255;
                        
SetPlayerSpecialAction(playeridSPECIAL_ACTION_STOPUSECELLPHONE);
                        return 
0;
                    }
                    if (
WantedPoints[badguy] > 0)
                    {
                        
SendClientMessage(playeridCOLOR_DBLUE"Polнcia HQ: As unidades jб sгo atribuнdas a esse caso.");
                        
SendClientMessage(playeridCOLOR_DBLUE"Obrigado por relatar esse crime.");
                        
Mobile[playerid] = 255;
                        
SetPlayerSpecialAction(playeridSPECIAL_ACTION_STOPUSECELLPHONE);
                        return 
0;
                    }
                    if (
badguy == playerid)
                    {
                        
SendClientMessage(playeridCOLOR_DBLUE"Polнcia HQ: Nгo insista, Esta й uma linha de emergкncia.");
                        
Mobile[playerid] = 255;
                        
SetPlayerSpecialAction(playeridSPECIAL_ACTION_STOPUSECELLPHONE);
                        return 
0;
                    }
                    
SendClientMessage(playeridCOLOR_DBLUE"Polнcia HQ: Nуs alertamos todas as unidades da бrea");
                    
SendClientMessage(playeridCOLOR_DBLUE"Obrigado por relatar esse crime.");
                    new 
Float:trace_xFloat:trace_yFloat:trace_z;
                    
GetPlayerPos(playeridtrace_xtrace_ytrace_z);
                    
pdtrace 1pdtrace_x trace_xpdtrace_y trace_ypdtrace_z trace_z;
                    
SetPlayerCriminal(badguy,playeridPlayerCrime[playerid][pAccusing]);
                    if(
WantedPoints[badguy] > 0) { } else { WantedPoints[badguy] += 1; }
                    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_STOPUSECELLPHONE);
                    
Mobile[playerid] = 255;
                    return 
0;
                }
                return 
0;
            }
            else
            {
                
format(stringsizeof(string), "Polнcia HQ: Nгo tenho informaзхes em '%s' vocк tem certeza de este ser o nome correto?",tmp);
                
SendClientMessage(playeridCOLOR_DBLUEstring);
                return 
0;
            }
        }
        if(
Mobile[playerid] == 190)//bugdocell
        
{
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_ALLDEPT"EMERGКNCIA: Desculpe, nгo estou entendendo");
                return 
0;
            }
            
strmid(PlayerCrime[playerid][pAccusing], text0strlen(text), 255);
            
SendClientMessage(playeridCOLOR_DBLUE"Polнcia HQ: Se vocк sabe o nome do agressor ou de parte dele, diga-o agora ou apenas diga 'nгo'.");
            
Mobile[playerid] = 913;
            return 
0;
        }
        if(
Mobile[playerid] == 190)
        {
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_ALLDEPT"EMERGКNCIA: Desculpe, nгo estou entendendo, 'Polнcia' ou 'Ambulвncia'?");
                return 
0;
            }
            else if ((
strcmp("Polнcia"tmptruestrlen(tmp)) == 0) && (strlen(tmp) == strlen("Polнcia")) || (strcmp("Policia"tmptruestrlen(tmp)) == 0) && (strlen(tmp) == strlen("Policia")))
            {
                
SendClientMessage(playeridCOLOR_ALLDEPT"EMERGКNCIA: Estou transferindo sua ligaзгo para a Polнcia HQ, mantenha calma.");
                
Mobile[playerid] = 912;
                
SendClientMessage(playeridCOLOR_DBLUE"Polнcia HQ: Por favor me dк uma breve descriзгo do crime.");
                return 
0;
            }
            else if ((
strcmp("Ambulвncia"tmptruestrlen(tmp)) == 0) && (strlen(tmp) == strlen("Ambulвncia")) || (strcmp("Ambulancia"tmptruestrlen(tmp)) == 0) && (strlen(tmp) == strlen("Ambulancia")))
            {
                
SendClientMessage(playeridCOLOR_ALLDEPT"EMERGКNCIA: Estou transferindo sua ligaзгo para o Hospital, mantenha calma.");
                
Mobile[playerid] = 914;
                
SendClientMessage(playeridTEAM_CYAN_COLOR"Despacho: Por favor me dк uma breve descriзгo do incidente.");
                return 
0;
            }
            else
            {
                
SendClientMessage(playeridCOLOR_ALLDEPT"EMERGКNCIA: Desculpe, nгo estou entendendo, 'Polнcia' ou 'Ambulвncia'?");
                return 
0;
            }
        }
        if(
IsPlayerConnected(Mobile[playerid]))
        {
            if(
Mobile[Mobile[playerid]] == playerid)
            {
                if(
PlayerInfo[Mobile[playerid]][pSpeaker] == 1)
                {
                    
ProxDetector(20.0Mobile[playerid], string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
                }
                else
                {
                    
SendClientMessage(Mobile[playerid], COLOR_YELLOW,string);
                }
            }
        }
        else
        {
            
SendClientMessage(playeridCOLOR_YELLOW,"O jogador saiu....");
            
SetPlayerSpecialAction(playeridSPECIAL_ACTION_STOPUSECELLPHONE);
            
Mobile[playerid] = 255;
            
CellTime[playerid] = 0;
            
RingTone[playerid] = 0;
        }
        return 
0;
    } 
Reply
#2

pawn Код:
if(phonenumb == PlayerInfo[playerid][pPnumber])
            {
                SendClientMessage(playerid, COLOR_GRAD2, "  Ocupado...");
                return 1;
            }

?
Reply
#3

Errei desculpa, aparece assim: O jogador saiu!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)