29.09.2017, 12:44
Esse Textdraw nгo funciona, jб tentei de tudo ms ainda nгo consegui resolver :/
Cуdigo ↓
forward showTextA@R( playerid );
public showTextA@R( playerid )
{
PlayerTextDrawSetSelectable(playerid, _ACEITAR[ playerid ], true );
PlayerTextDrawSetSelectable(playerid, _RECUSAR[ playerid ], true );
PlayerTextDrawShow( playerid, _INFO[ playerid ] );
PlayerTextDrawShow( playerid, _ICONE[ playerid ] );
format( gstring, sizeof( gstring ), "Traficante ~r~~h~%s~n~~n~~w~Oferece: ~h~%s~n~~w~Por: ~g~~h~$%d", PlayerName( compraArm[ playerid ] ), ArmaNome( armaEscol[ playerid ] ), preccArma[ playerid ] );
PlayerTextDrawSetString( playerid, _MSGFORM[ playerid ], gstring );
PlayerTextDrawShow( playerid, _MSGFORM[ playerid ] );
PlayerTextDrawShow( playerid, _ACEITAR[ playerid ] );
PlayerTextDrawShow( playerid, _RECUSAR[ playerid ] );
PlayerTextDrawShow( playerid, _MSGTEMPO[ playerid ] );
SelectTextDraw( playerid, COLOR_ERRO );
return 1;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText
layertextid)
{
if(_
layertextid == INVALID_TEXT_DRAW)
return CallLocalFunction("OnPlayerClickPlayerTextDraw", "ii", playerid, INVALID_TEXT_DRAW);
if(playertextid == _ACEITAR[ playerid ])
{
format( gstring, 256, "[ > ] Vocк aceitou a arma %s vendida por %s para vocк por $%d", ArmaNome( armaEscol[ playerid ] ), PlayerName( compraArm[ playerid ] ), preccArma[ playerid ] );
SendClientMessage( playerid, COLOR_AMARELO, gstring );
format( gstring, 256, "[ > ] %s aceitou a arma %s vendida por vocк pelo valor $%d", PlayerName( playerid ), ArmaNome( armaEscol[ playerid ] ), preccArma[ playerid ] );
SendClientMessage( compraArm[ playerid ], COLOR_AMARELO, gstring );
GivePlayerCash( playerid, -preccArma[ playerid ] );
GivePlayerCash( compraArm[ playerid ], preccArma[ playerid ] );
TraficArma( playerid );
new
stg[ 512 ]
;
format( gstring, sizeof( gstring ), "\tARMA ILEGAL\n\n{23C8D0}> Essa arma й ilegal, vocк aceitou e pode utilizar a mesma sem sair do server.\n\n" );
strcat( stg, gstring );
format( gstring, sizeof( gstring ), "{23C8D0}> A mesma nгo й salva, apуs se desconectar-se do servidor vocк perde a arma.\n" );
strcat( stg, gstring );
format( gstring, sizeof( gstring ), "{23C8D0}> Caso vocк seja parado por policiais, vocк estб sujeito a ser preso por uso de armas ilegais.\n" );
strcat( stg, gstring );
format( gStr, sizeof( gStr ), "{23C8D0}> Vocк sу pode usar uma arma ilegal, caso compre outra a atual serб substituнda.\n" );
strcat( stg, gStr );
ShowPlayerDialog( playerid, D_PARMA+3, DIALOG_STYLE_MSGBOX, "Arma Ilegal", stg, "OK", "" );
}
else if(playertextid == _RECUSAR[ playerid ])
{
format( gstring, 256, "[ x ] Vocк recusou a arma %s oferecida por %s para vocк por $%d", ArmaNome( armaEscol[ playerid ] ), PlayerName( compraArm[ playerid ] ), preccArma[ playerid ] );
SendClientMessage( playerid, COLOR_ERRO, gstring );
format( gstring, 256, "[ x ] %s recusou a arma %s oferecida por vocк por $%d", PlayerName( playerid ), ArmaNome( compraArm[ playerid ] ), preccArma[ playerid ] );
SendClientMessage( compraArm[ playerid ], COLOR_ERRO, gstring );
}
KillTimer( timerarms[ playerid ] );
PlayerTextDrawHide(playerid, _INFO[ playerid ]);
PlayerTextDrawHide(playerid, _ICONE[ playerid ]);
PlayerTextDrawHide(playerid, _MSGFORM[ playerid ]);
PlayerTextDrawHide(playerid, _ACEITAR[ playerid ]);
PlayerTextDrawHide(playerid, _RECUSAR[ playerid ]);
PlayerTextDrawHide(playerid, _MSGTEMPO[ playerid ]);
CancelSelectTextDraw(playerid);
compraArm[ playerid ] = -1;
compraArm[ compraArm[ playerid ] ] = -1;
preccArma[ playerid ] = -1;
preccArma[ preccArma[ playerid ] ] = -1;
armaEscol[ playerid ] = -1;
armaEscol[ armaEscol[ playerid ] ] = -1;
temptemp_[ playerid ] = -1;
return 0;
}
forward tempomsgt( playerid );
public tempomsgt( playerid )
{
if( temptemp_[ playerid ] <= 0 )
{
KillTimer( timerarms[ playerid ] );
PlayerTextDrawHide(playerid, _INFO[ playerid ]);
PlayerTextDrawHide(playerid, _ICONE[ playerid ]);
PlayerTextDrawHide(playerid, _MSGFORM[ playerid ]);
PlayerTextDrawHide(playerid, _ACEITAR[ playerid ]);
PlayerTextDrawHide(playerid, _RECUSAR[ playerid ]);
PlayerTextDrawHide(playerid, _MSGTEMPO[ playerid ]);
CancelSelectTextDraw(playerid);
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк demorou para responder a oferta de armas !" );
format( gStr, 128, "[ x ] %s demorou para responder a oferta de armas !", PlayerName( playerid ));
SendClientMessage( compraArm[ playerid ], COLOR_ERRO, gStr );
compraArm[ playerid ] = -1;
compraArm[ compraArm[ playerid ] ] = -1;
preccArma[ playerid ] = -1;
preccArma[ preccArma[ playerid ] ] = -1;
armaEscol[ playerid ] = -1;
armaEscol[ armaEscol[ playerid ] ] = -1;
temptemp_[ playerid ] = -1;
return 1;
}
else if( temptemp_[ playerid ] > 0 )
{
temptemp_[ playerid ] --;
new
strTem[ 12 ]
;
format( strTem, sizeof( strTem ), "Tempo~n~%d", temptemp_[ playerid ] );
PlayerTextDrawSetString( playerid, _MSGTEMPO[ playerid ], strTem );
timerarms[ playerid ] = SetTimerEx( "tempomsgt", 1000, false, "d", playerid );
}
return 1;
}
Cуdigo ↓
forward showTextA@R( playerid );
public showTextA@R( playerid )
{
PlayerTextDrawSetSelectable(playerid, _ACEITAR[ playerid ], true );
PlayerTextDrawSetSelectable(playerid, _RECUSAR[ playerid ], true );
PlayerTextDrawShow( playerid, _INFO[ playerid ] );
PlayerTextDrawShow( playerid, _ICONE[ playerid ] );
format( gstring, sizeof( gstring ), "Traficante ~r~~h~%s~n~~n~~w~Oferece: ~h~%s~n~~w~Por: ~g~~h~$%d", PlayerName( compraArm[ playerid ] ), ArmaNome( armaEscol[ playerid ] ), preccArma[ playerid ] );
PlayerTextDrawSetString( playerid, _MSGFORM[ playerid ], gstring );
PlayerTextDrawShow( playerid, _MSGFORM[ playerid ] );
PlayerTextDrawShow( playerid, _ACEITAR[ playerid ] );
PlayerTextDrawShow( playerid, _RECUSAR[ playerid ] );
PlayerTextDrawShow( playerid, _MSGTEMPO[ playerid ] );
SelectTextDraw( playerid, COLOR_ERRO );
return 1;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText
layertextid){
if(_
layertextid == INVALID_TEXT_DRAW)return CallLocalFunction("OnPlayerClickPlayerTextDraw", "ii", playerid, INVALID_TEXT_DRAW);
if(playertextid == _ACEITAR[ playerid ])
{
format( gstring, 256, "[ > ] Vocк aceitou a arma %s vendida por %s para vocк por $%d", ArmaNome( armaEscol[ playerid ] ), PlayerName( compraArm[ playerid ] ), preccArma[ playerid ] );
SendClientMessage( playerid, COLOR_AMARELO, gstring );
format( gstring, 256, "[ > ] %s aceitou a arma %s vendida por vocк pelo valor $%d", PlayerName( playerid ), ArmaNome( armaEscol[ playerid ] ), preccArma[ playerid ] );
SendClientMessage( compraArm[ playerid ], COLOR_AMARELO, gstring );
GivePlayerCash( playerid, -preccArma[ playerid ] );
GivePlayerCash( compraArm[ playerid ], preccArma[ playerid ] );
TraficArma( playerid );
new
stg[ 512 ]
;
format( gstring, sizeof( gstring ), "\tARMA ILEGAL\n\n{23C8D0}> Essa arma й ilegal, vocк aceitou e pode utilizar a mesma sem sair do server.\n\n" );
strcat( stg, gstring );
format( gstring, sizeof( gstring ), "{23C8D0}> A mesma nгo й salva, apуs se desconectar-se do servidor vocк perde a arma.\n" );
strcat( stg, gstring );
format( gstring, sizeof( gstring ), "{23C8D0}> Caso vocк seja parado por policiais, vocк estб sujeito a ser preso por uso de armas ilegais.\n" );
strcat( stg, gstring );
format( gStr, sizeof( gStr ), "{23C8D0}> Vocк sу pode usar uma arma ilegal, caso compre outra a atual serб substituнda.\n" );
strcat( stg, gStr );
ShowPlayerDialog( playerid, D_PARMA+3, DIALOG_STYLE_MSGBOX, "Arma Ilegal", stg, "OK", "" );
}
else if(playertextid == _RECUSAR[ playerid ])
{
format( gstring, 256, "[ x ] Vocк recusou a arma %s oferecida por %s para vocк por $%d", ArmaNome( armaEscol[ playerid ] ), PlayerName( compraArm[ playerid ] ), preccArma[ playerid ] );
SendClientMessage( playerid, COLOR_ERRO, gstring );
format( gstring, 256, "[ x ] %s recusou a arma %s oferecida por vocк por $%d", PlayerName( playerid ), ArmaNome( compraArm[ playerid ] ), preccArma[ playerid ] );
SendClientMessage( compraArm[ playerid ], COLOR_ERRO, gstring );
}
KillTimer( timerarms[ playerid ] );
PlayerTextDrawHide(playerid, _INFO[ playerid ]);
PlayerTextDrawHide(playerid, _ICONE[ playerid ]);
PlayerTextDrawHide(playerid, _MSGFORM[ playerid ]);
PlayerTextDrawHide(playerid, _ACEITAR[ playerid ]);
PlayerTextDrawHide(playerid, _RECUSAR[ playerid ]);
PlayerTextDrawHide(playerid, _MSGTEMPO[ playerid ]);
CancelSelectTextDraw(playerid);
compraArm[ playerid ] = -1;
compraArm[ compraArm[ playerid ] ] = -1;
preccArma[ playerid ] = -1;
preccArma[ preccArma[ playerid ] ] = -1;
armaEscol[ playerid ] = -1;
armaEscol[ armaEscol[ playerid ] ] = -1;
temptemp_[ playerid ] = -1;
return 0;
}
forward tempomsgt( playerid );
public tempomsgt( playerid )
{
if( temptemp_[ playerid ] <= 0 )
{
KillTimer( timerarms[ playerid ] );
PlayerTextDrawHide(playerid, _INFO[ playerid ]);
PlayerTextDrawHide(playerid, _ICONE[ playerid ]);
PlayerTextDrawHide(playerid, _MSGFORM[ playerid ]);
PlayerTextDrawHide(playerid, _ACEITAR[ playerid ]);
PlayerTextDrawHide(playerid, _RECUSAR[ playerid ]);
PlayerTextDrawHide(playerid, _MSGTEMPO[ playerid ]);
CancelSelectTextDraw(playerid);
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк demorou para responder a oferta de armas !" );
format( gStr, 128, "[ x ] %s demorou para responder a oferta de armas !", PlayerName( playerid ));
SendClientMessage( compraArm[ playerid ], COLOR_ERRO, gStr );
compraArm[ playerid ] = -1;
compraArm[ compraArm[ playerid ] ] = -1;
preccArma[ playerid ] = -1;
preccArma[ preccArma[ playerid ] ] = -1;
armaEscol[ playerid ] = -1;
armaEscol[ armaEscol[ playerid ] ] = -1;
temptemp_[ playerid ] = -1;
return 1;
}
else if( temptemp_[ playerid ] > 0 )
{
temptemp_[ playerid ] --;
new
strTem[ 12 ]
;
format( strTem, sizeof( strTem ), "Tempo~n~%d", temptemp_[ playerid ] );
PlayerTextDrawSetString( playerid, _MSGTEMPO[ playerid ], strTem );
timerarms[ playerid ] = SetTimerEx( "tempomsgt", 1000, false, "d", playerid );
}
return 1;
}

