[Ajuda] TV - Spect Player
#1

Intao Como Pode Ver
format(STR, sizeof(STR), "~b~Nome~w~ : ~y~%s", TvNome);
PlayerTextDrawSetString(playerid, TV_SPEC[1][playerid], STR);
Eu Coloquei Para Endicar o nome da Pessoa quando da /tv Mais Desaparece A Text Oque EU Posso Fazer Para Nao Desaparecer ,
PHP код:
CMD:tv(playerid,params[])
{
        if(!
TV[playerid])
        {
        new 
id, string[124], TvNome[24], STR[12];
        {
        if(
sscanf(params,"d",id)) return SendClientMessage(playerid,-1,"Uso: /tv [ID]");
        
GetPlayerName(id, TvNome, 24);
        }
///////////////////////////////////////////////////////////////////////////////////////////
        
format(STR, sizeof(STR), "~b~Nome~w~ : ~y~%s", TvNome);
        
PlayerTextDrawSetString(playerid, TV_SPEC[1][playerid], STR);
///////////////////////////////////////////////////////////////////////////////////////////
        
GameTextForPlayer(playerid, "~w~                TV~n~~r~                On", 5000, 6);
        
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
         
TogglePlayerSpectating(playerid, 1);
        
PlayerSpectatePlayer(playerid, id);
           
format(string, sizeof(string), "Vocк Esta De TV Em {00BFFF}(%s)", TvNome);
        
SendClientMessage(playerid, -1, string);
        
PlayerTextDrawShow(playerid, TV_SPEC[0][playerid]);
        
PlayerTextDrawShow(playerid, TV_SPEC[1][playerid]);
        
PlayerTextDrawShow(playerid, TV_SPEC[2][playerid]);
        
PlayerTextDrawShow(playerid, TV_SPEC[3][playerid]);
        
PlayerTextDrawShow(playerid, TV_SPEC[4][playerid]);
        
TV[playerid] = true;
        }
             else
         {
        
TogglePlayerSpectating(playerid, 0);
        
GameTextForPlayer(playerid, "~w~                TV~n~~r~                Off", 5000, 6);
        
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
        
PlayerTextDrawHide(playerid, TV_SPEC[0][playerid]);
        
PlayerTextDrawHide(playerid, TV_SPEC[1][playerid]);
        
PlayerTextDrawHide(playerid, TV_SPEC[2][playerid]);
        
PlayerTextDrawHide(playerid, TV_SPEC[3][playerid]);
        
PlayerTextDrawHide(playerid, TV_SPEC[4][playerid]);
        
GameTextForPlayer(playerid,"TV:~r~OFF",2000,6);
        
TV[playerid] = false;
    }
        return 
1;
} 
Reply
#2

Alguem , UP
Reply
#3

Nгo entendi nada..
Oque vocк quer fazer?
Reply
#4

PHP код:
/////////////////////////////////////////////////////////////////////////////////////////// 
        
format(STR, sizeof(STR), "~b~Nome~w~ : ~y~%s", TvNome); 
        
PlayerTextDrawSetString(playerid, TV_SPEC[1][playerid], STR); 
/////////////////////////////////////////////////////////////////////////////////////////// 
Essa Funзao de TextDraw Esta no Comando Mais Na Hora Que Eu Digito o Comando Isso Desaparece Nao Mostra Some a Text
Reply
#5

Cara que cуdigo embolado..

Olha, refiz pra vocк, mais estude o, compare com o seu e veja oque vocк esta errando !!

PHP код:
CMD:tv(playerid,params[])
{
    if(
TV[playerid] == false)
    {
        new 
id;
        if(
sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"Uso: /tv [ID]");
        new 
TvNome[24];
        
GetPlayerName(id, TvNome, 24);
        new 
STR[45];
        
format(STR, sizeof(STR), "~b~Nome~w~ : ~y~%s", TvNome);
        
PlayerTextDrawSetString(playerid, TV_SPEC[1][playerid], STR);
        
GameTextForPlayer(playerid, "~w~                TV~n~~r~                On", 5000, 6);
        
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
        
TogglePlayerSpectating(playerid, 1);
        
PlayerSpectatePlayer(playerid, id);
        for(new 
i = 0; i < 5; i++) PlayerTextDrawShow(playerid, TV_SPEC[i][playerid]);
        
        new 
string[15];
        
format(string, sizeof(string), "Vocк Esta De TV Em {00BFFF}(%s)", TvNome);
        
SendClientMessage(playerid, -1, string);
        
        
TV[playerid] = true;
    } else {
    
        
TogglePlayerSpectating(playerid, 0);
        
GameTextForPlayer(playerid, "~w~                TV~n~~r~                Off", 5000, 6);
        
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
        
        for(new 
i = 0; i < 5; i++) PlayerTextDrawHide(playerid, TV_SPEC[i][playerid]);
        
        
GameTextForPlayer(playerid,"TV:~r~OFF",2000,6);
        
TV[playerid] = false;
    }
    return 
1;
} 
Reply
#6

Quote:
Originally Posted by Cleyson
Посмотреть сообщение
Cara que cуdigo embolado..

Olha, refiz pra vocк, mais estude o, compare com o seu e veja oque vocк esta errando !!

PHP код:
CMD:tv(playerid,params[])
{
    if(
TV[playerid] == false)
    {
        new 
id;
        if(
sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"Uso: /tv [ID]");
        new 
TvNome[24];
        
GetPlayerName(id, TvNome, 24);
        new 
STR[45];
        
format(STR, sizeof(STR), "~b~Nome~w~ : ~y~%s", TvNome);
        
PlayerTextDrawSetString(playerid, TV_SPEC[1][playerid], STR);
        
GameTextForPlayer(playerid, "~w~                TV~n~~r~                On", 5000, 6);
        
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
        
TogglePlayerSpectating(playerid, 1);
        
PlayerSpectatePlayer(playerid, id);
        for(new 
i = 0; i < 5; i++) PlayerTextDrawShow(playerid, TV_SPEC[i][playerid]);
        
        new 
string[15];
        
format(string, sizeof(string), "Vocк Esta De TV Em {00BFFF}(%s)", TvNome);
        
SendClientMessage(playerid, -1, string);
        
        
TV[playerid] = true;
    } else {
    
        
TogglePlayerSpectating(playerid, 0);
        
GameTextForPlayer(playerid, "~w~                TV~n~~r~                Off", 5000, 6);
        
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
        
        for(new 
i = 0; i < 5; i++) PlayerTextDrawHide(playerid, TV_SPEC[i][playerid]);
        
        
GameTextForPlayer(playerid,"TV:~r~OFF",2000,6);
        
TV[playerid] = false;
    }
    return 
1;
} 
Cleyson Como Eu Posso Fazer Para Ver A Arma que o Jogador Esta ?
Reply
#7

Quote:
Originally Posted by JuniorTheDM
Посмотреть сообщение
Cleyson Como Eu Posso Fazer Para Ver A Arma que o Jogador Esta ?
http://www.wiki.sa-mp.com/wiki/GetPlayerWeapon
Reply
#8

Quote:
Originally Posted by ipsLeon
Посмотреть сообщение
Leon Eu Fiz Uma Coisa Aki e Ta Aparecendo Arma = Nenhuma Olha So
PHP код:
stock NomeArma(armaid)
{
    new 
nome[35];
    if(
armaid < 1 || armaid > 47)nome = "Nenhuma";
    else if(
armaid == 24)nome = "Eagle";
    else if(
armaid == 25)nome = "Shotgun";
    else if(
armaid == 34)nome = "Sniper";
    else if(
armaid == 18)nome = "Molotov";
    else if(
armaid == 44 || armaid == 45)nome = "Visao Noturna";
    else if(
armaid == 47)nome = "Explosivo";
    else 
GetWeaponName(armaid, nome, sizeof nome);
    return 
nome;
}
        
format(STR, sizeof(STR), "~b~Arma~w~ : ~y~%s", NomeArma(id));
        
PlayerTextDrawSetString(playerid, TV_SPEC[0][playerid], STR); 
Reply
#9

Vocк vai precisar verificar quando ele vai mudar de arma, use a minha include iBranch pra isso.
Reply
#10

Pronto Leon Baixei ela como posso fazer agr ;/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)