[FilterScript] Cloud Tunning - Alpha v1.0
#7

PHP код:
new vehicleid;
vehicleid GetPlayerVehicleID(playerid);
if(
IsPlayerInAnyVehicle(playerid))
{

Vocк nгo precisa utilizar a funзгo IsPlayerInAnyVehicle, pois a funзгo GetPlayerVehicleID retorna 0 se o jogador nгo estiver em um veнculo.

PHP код:
stock gAngle(playerid)
{
    new 
vehicleid;
    if(
IsPlayerInAnyVehicle(playerid)) vehicleid GetPlayerVehicleID(playerid); //bloco 1 com restriзгo
    
{
        
//bloco 2 sem restriзхes
        
GetVehiclePos(vehicleidxCoordyCoordzCoord);
        
GetVehicleZAngle(vehicleidaCoord);
    }
    return 
1;

No cуdigo acima existem 2 blocos um com restriзгo de entrada que й o bloco 1 que sу vai entrar ali caso o jogador esteja em um veнculo, e o bloco 2 de que qualquer maneira sempre vai entrar ali.

Exemplo:
PHP код:
main(){
    new 
ab;
    
8;
    if(
== 71;
    {
        
printf("a: %d | b: %d"ab);
    }
    
//Saнda: a: 0 | b: 8

PHP код:
if(listitem == && aAttach[vehicleid] == 0)
{
    
Spoiler(playerid);
    
SetObjectMaterial(cMaterial[playerid], 019341"break_f_w""dyn_f_r_wood_1b"DodgerBlue);
    
AttachObjectToVehicle(cMaterial[playerid] , vehicleid0.010000, -2.1650010.359999000);
}
if(
listitem == && aAttach[vehicleid] == 0)
{
    
Spoiler(playerid);
    
SetObjectMaterial(cMaterial[playerid], 019341"break_f_w""dyn_f_r_wood_1b"DeepSkyBlue);
    
AttachObjectToVehicle(cMaterial[playerid] , vehicleid0.010000, -2.1650010.359999000);
}
//...
if(listitem == 11 && aAttach[vehicleid] == 1)
{
    
DestroyObject(cMaterial[playerid]);
    
aAttach[vehicleid] = 0;

Na parte da verificaзгo do listitem do diбlogo DIALOG_COR_TUNNING em vez de verificar se o listitem й igual a um valor e se aAttach for igual a 0, faзa como abaixo:

PHP код:
if(aAttach[vehicleid]){
    if(
listitem == 11)
    {
        
DestroyObject(cMaterial[playerid]);
        
aAttach[vehicleid] = 0;
    }
}
else{
    if(
listitem == 0)
    {
        
Spoiler(playerid);
        
SetObjectMaterial(cMaterial[playerid], 019341"break_f_w""dyn_f_r_wood_1b"DodgerBlue);
        
AttachObjectToVehicle(cMaterial[playerid] , vehicleid0.010000, -2.1650010.359999000);
    }
    
//...

PHP код:
if(response)
{
    
ShowPlayerDialog(playeridDIALOG_MENU_TUNNINGDIALOG_STYLE_LIST"Selecione o que deseja tunar""Spoilers Coloridos""OK""Voltar");
}
else
{
    
SetCameraBehindPlayer(playerid);

Nгo entendi essa parte, vocк quer que toda vez que um diбlogo seja chamado e o jogador faзa alguma aзгo nesse diбlogo (fechar, clicar no botгo 1 ou botгo 2) essa parte seja executada?


PHP код:
if(!response)
{
    
setAngle(playerid);
    
SendClientMessage(playerid, -1"{254AA1}[INFO]: Vocк saiu da Oficina.");
    }
    if(
response)
    {
        
ShowPlayerDialog(playeridDIALOG_MENU_TUNNINGDIALOG_STYLE_LIST"Selecione o que quer tunar""Spoilers Coloridos""OK""Voltar");

Nгo hб necessidade de fazer duas verificaзхes faзa uma e use um else.

OnPlayerKeyStateChange:

PHP код:
if(GetVehicleModel(vehicleid) != 560)    return SendClientMessage(playerid, -1"{A12525}[ERRO]: Nosso Sistema ainda estб em fase ALPHA, e sу tem suporte para tunar o Sultan !");
{

Abaixo da verificaзгo se o modelo do veнculo nгo й igual 560 vocк criou um bloco sem restriзхes, mas nesse caso ele sу vai entrar caso o modelo do veнculo for igual a 560 por causa do retorno que vocк colocou na verificaзгo acima. Esse bloco nгo й necessбrio.

PHP код:
if(IsPlayerInAnyVehicle(playerid)) vehicleid GetPlayerVehicleID(playerid);
{

Alйm de vocк criar dois blocos, a verificaзгo se o player esta em um veнculo nгo й necessбria pois jб foi feita acima e sу chegara nessa parte do cуdigo se o jogador estiver em um veнculo, e tambйm vocк jб armazenou o id do veнculo em que o jogador esta.

PHP код:
else if(GetPlayerVehicleID(vehicleid == 560)) 
Supondo que isso seja um erro na hora de escrever que era pra verificar se o modelo do veнculo do jogador seja igual a 560, nгo hб necessidade de verificar pois essa verificaзгo jб foi feita antes. Caso nгo seja isso nгo entendi o que vocк fez.


Parabйns pelo sistema.
Reply


Messages In This Thread
Cloud Tunning - Alpha v1.0 - by ClaudioF - 13.08.2017, 04:39
Re: Cloud Tunning - Alpha v1.0 - by Relaxed - 13.08.2017, 05:29
Re: Cloud Tunning - Alpha v1.0 - by PT - 13.08.2017, 10:46
Re: Cloud Tunning - Alpha v1.0 - by ClaudioF - 13.08.2017, 13:58
Re: Cloud Tunning - Alpha v1.0 - by Felpz - 13.08.2017, 15:12
Re: Cloud Tunning - Alpha v1.0 - by ClaudioF - 13.08.2017, 15:35
Re: Cloud Tunning - Alpha v1.0 - by MultiKill - 13.08.2017, 16:33
Re: Cloud Tunning - Alpha v1.0 - by ClaudioF - 13.08.2017, 16:43

Forum Jump:


Users browsing this thread: 6 Guest(s)