[AJUDA] Por Favor
#1

peguei esse sistema de criar carros em dialog,mais ele tem um probleminha por que quando cria um carro e depois vou criar outro fica os dois eu qeuro que destrua o outro veiculo e fique sу com um
(OBS: ja tentei fazer isso mais nao deu muito certo)

Aqui o link do filterscript :https://sampforum.blast.hk/showthread.php?tid=97939

Agradeзo desde jб
Reply
#2

PHP код:
#include <a_samp>
//#define IGNORE_WARP_INTO_VEHICLE
//#define IGNORE_VIRTUAL_WORLDS
//#define IGNORE_SPAWN_MESSAGES
//#define IGNORE_VEHICLE_ACTIVATION
//#define IGNORE_VEHICLE_DELETION
#define DEFAULT_RESPAWN_TIME        600 /* ten minutes */
#if !defined IGNORE_VEHICLE_DELETION
    
new
        
bool:gDialogCreatedMAX_VEHICLES ] = { false, ... };
#endif
CreatePlayerVehicleplayeridmodelid )
{
    new
        
vehicle,
        
Float:x,
        
Float:y,
        
Float:z,
        
Float:angle;
    if ( 
GetPlayerStateplayerid ) == PLAYER_STATE_DRIVER )
    {
        
vehicle GetPlayerVehicleIDplayerid );
        
GetVehiclePosvehiclexy);
        
GetVehicleZAnglevehicleangle );
        
DestroyVehiclevehicle );
    }
    else
    {
        
GetPlayerPosplayeridxy);
        
GetPlayerFacingAngleplayeridangle );
    }
             
DestroyVehiclevehicle );//add issu <
vehicle CreateVehiclemodelidxy, ( ), angle, -1, -1DEFAULT_RESPAWN_TIME );
    
LinkVehicleToInteriorvehicleGetPlayerInteriorplayerid ) );
    
#if !defined IGNORE_VIRTUAL_WORLDS
        
SetVehicleVirtualWorldvehicleGetPlayerVirtualWorldplayerid ) );
    
#endif
    #if !defined IGNORE_WARP_INTO_VEHICLE
        
PutPlayerInVehicleplayeridvehicle);
    
#endif
    #if !defined IGNORE_VEHICLE_DELETION
        
gDialogCreatedvehicle ] = true;
    
#endif
    
return 1;
}
ShowPlayerDefaultDialogplayerid )
{
    
ShowPlayerDialogplayerid3434DIALOG_STYLE_LIST"Vehicle Types""Airplanes\nHelicopters\nBikes\nConvertibles\nIndustrial\nLowriders\nOff Road\nPublic Service Vehicles\nSaloons\nSport Vehicles\nStation Wagons\nBoats\nTrailers\nUnique Vehicles\nRC Vehicles""Select""Cancel" );
    return 
1;
}
public 
OnFilterScriptInit()
{
    
printf"   * vDialog version 0.2a loaded *        " );
    return 
1;
}
public 
OnFilterScriptExit()
{
    
printf"   * vDialog version 0.2a unloaded *        " );
    return 
1;
}
public 
OnPlayerSpawnplayerid )
{
    
#if !defined IGNORE_SPAWN_MESSAGES
        
SendClientMessageplayerid0xFFFFFFFF"[vDialog]: Use the command '/vdialog' to activate the vehicle dialog" );
    
#endif
    
return 1;
}
public 
OnPlayerCommandTextplayeridcmdtext[] )
{
    if ( 
strcmpcmdtext"/vdialog"true) == )
    {
        if ( 
GetPlayerStateplayerid ) == PLAYER_STATE_DRIVER )
        {
            
#if !defined IGNORE_VEHICLE_ACTIVATION
                
ShowPlayerDefaultDialogplayerid );
                return 
1;
            
#endif
        
}
        if ( 
GetPlayerStateplayerid ) != PLAYER_STATE_PASSENGER ShowPlayerDefaultDialogplayerid );
        return 
1;
    }
    return 
0;
}
public 
OnVehicleSpawnvehicleid )
{
    
#if !defined IGNORE_VEHICLE_DELETION
        
if ( gDialogCreatedvehicleid ] )
        {
            
DestroyVehiclevehicleid );
            
gDialogCreatedvehicleid ] = false;
        }
    
#endif
    
return 1;
}
public 
OnDialogResponseplayeriddialogidresponselistiteminputtext[] )
{
    if ( 
response )
    {
        switch ( 
dialogid )
        {
            case 
3434 :
            {
                switch ( 
listitem )
                {
                    case 
ShowPlayerDialogplayerid3435DIALOG_STYLE_LIST"Airplanes""Andromada\nAT-400\nBeagle\nCropduster\nDodo\nHydra\nNevada\nRustler\nShamal\nSkimmer\nStuntplane\nBack""Select""Cancel" );
                    case 
ShowPlayerDialogplayerid3436DIALOG_STYLE_LIST"Helicopters""Cargobob\nHunter\nLeviathan\nMaverick\nNews Maverick\nPolice Maverick\nRaindance\nSeasparrow\nSparrow\nBack""Select""Cancel" );
                    case 
ShowPlayerDialogplayerid3437DIALOG_STYLE_LIST"Bikes""BF-400\nBike\nBMX\nFaggio\nFCR-900\nFreeway\nMountain Bike\nNRG-500\nPCJ-600\nPizzaboy\nQuad\nSanchez\nWayfarer\nBack""Select""Cancel" );
                    case 
ShowPlayerDialogplayerid3438DIALOG_STYLE_LIST"Convertibles""Comet\nFeltzer\nStallion\nWindsor\nBack""Select""Cancel" );
                    case 
ShowPlayerDialogplayerid3439DIALOG_STYLE_LIST"Industrial""Benson\nBobcat\nBurrito\nBoxville\nBoxburg\nCement Truck\nDFT-30\nFlatbed\nLinerunner\nMule\nNewsvan\nPacker\nPetrol Tanker\nPony\nRoadtrain\nRumpo\nSadler\nSadler Shit\nTopfun\nTractor\nTrashmaster\nUtility Van\nWalton\nYankee\nYosemite\nBack""Select""Cancel" );
                    case 
ShowPlayerDialogplayerid3440DIALOG_STYLE_LIST"Lowriders""Blade\nBroadway\nRemington\nSavanna\nSlamvan\nTahoma\nTornado\nVoodoo\nBack""Select""Cancel" );
                    case 
ShowPlayerDialogplayerid3441DIALOG_STYLE_LIST"Off Road""Bandito\nBF Injection\nDune\nHuntley\nLandstalker\nMesa\nMonster\nMonster A\nMonster B\nPatriot\nRancher A\nRancher B\nSandking\nBack""Select""Cancel" );
                    case 
ShowPlayerDialogplayerid3442DIALOG_STYLE_LIST"Public Service Vehicles""Ambulance\nBarracks\nBus\nCabbie\nCoach\nCop Bike (HPV-1000)\nEnforcer\nFBI Rancher\nFBI Truck\nFiretruck\nFiretruck LA\nPolice Car (LSPD)\nPolice Car (LVPD)\nPolice Car (SFPD)\nRanger\nRhino\nS.W.A.T\nTaxi\nBack""Select""Cancel" );
                    case 
ShowPlayerDialogplayerid3443DIALOG_STYLE_LIST"Saloons""Admiral\nBloodring Banger\nBravura\nBuccaneer\nCadrona\nClover\nElegant\nElegy\nEmperor\nEsperanto\nFortune\nGlendale Shit\nGlendale\nGreenwood\nHermes\nIntruder\nMajestic\nManana\nMerit\nNebula\nOceanic\nPicador\nPremier\nPrevion\nPrimo\nSentinel\nStafford\nSultan\nSunrise\nTampa\nVincent\nVirgo\nWillard\nWashington\nBack""Select""Cancel" );
                    case 
ShowPlayerDialogplayerid3444DIALOG_STYLE_LIST"Sport Vehicles""Alpha\nBanshee\nBlista Compact\nBuffalo\nBullet\nCheetah\nClub\nEuros\nFlash\nHotring Racer\nHotring Racer A\nHotring Racer B\nInfernus\nJester\nPhoenix\nSabre\nSuper GT\nTurismo\nUranus\nZR-350\nBack""Select""Cancel" );
                    case 
10 ShowPlayerDialogplayerid3445DIALOG_STYLE_LIST"Station Wagons""Moonbeam\nPerenniel\nRegina\nSolair\nStratum\nBack""Select""Cancel" );
                    case 
11 ShowPlayerDialogplayerid3446DIALOG_STYLE_LIST"Boats""Coastguard\nDinghy\nJetmax\nLaunch\nMarquis\nPredator\nReefer\nSpeeder\nSquallo\nTropic\nBack""Select""Cancel" );
                    case 
12 ShowPlayerDialogplayerid3447DIALOG_STYLE_LIST"Trailers""Article Trailer\nArticle Trailer 2\nArticle Trailer 3\nBaggage Trailer A\nBaggage Trailer B\nFarm Trailer\nFreight Flat Trailer (Train)\nFreight Box Trailer (Train)\nPetrol Trailer\nStreak Trailer (Train)\nStairs Trailer\nUtility Trailer\nBack""Select""Cancel" );
                    case 
13 ShowPlayerDialogplayerid3448DIALOG_STYLE_LIST"Unique Vehicles""Baggage\nBrownstreak (Train)\nCaddy\nCamper\nCamper A\nCombine Harvester\nDozer\nDumper\nForklift\nFreight (Train)\nHotknife\nHustler\nHotdog\nKart\nMower\nMr Whoopee\nRomero\nSecuricar\nStretch\nSweeper\nTram\nTowtruck\nTug\nVortex\nBack""Select""Cancel" );
                    case 
14 ShowPlayerDialogplayerid3449DIALOG_STYLE_LIST"RC Vehicles""RC Bandit\nRC Baron\nRC Raider\nRC Goblin\nRC Tiger\nRC Cam\nBack""Select""Cancel" );
                }
            }
            case 
3435 :
            {
                if ( 
listitem 10 ) return ShowPlayerDefaultDialogplayerid );
            
                   new
                      
model_array[] = { 592577511512593520553476519460513 };
                    
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3436 :
            {
                if ( 
listitem ) return ShowPlayerDefaultDialogplayerid );
                new
                    
model_array[] = { 548425417487488497563447469 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3437 :
            {
                if ( 
listitem 12 ) return ShowPlayerDefaultDialogplayerid );
                new
                       
model_array[] = { 581509481462521463510522461448471468586 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3438 :
            {
                if ( 
listitem ) return ShowPlayerDefaultDialogplayerid );
            
                   new
                    
model_array[] = { 480533439555 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3439 :
            {
                if ( 
listitem 24 ) return ShowPlayerDefaultDialogplayerid );
                new
                    
model_array[] = { 499422482498609524578455403414582443514413515440543605459531408552478456554 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3440 :
            {
                if ( 
listitem ) return ShowPlayerDefaultDialogplayerid );
                new
                    
model_array[] = { 536575534567535566576412 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3441 :
            {
                if ( 
listitem 12 ) return ShowPlayerDefaultDialogplayerid );
                
                new
                    
model_array[] = { 568424573579400500444556557470489505495 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3442 :
            {
                if ( 
listitem 17 ) return ShowPlayerDefaultDialogplayerid );
                new
                    
model_array[] = { 416433431438437523427490528407544596598597599432601420 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3443 :
            {
                if ( 
listitem 33 ) return ShowPlayerDefaultDialogplayerid );
            
                new
                    
model_array[] = { 445504401518527542507562585419526604466492474546517410551516467600426436547405580560550549540491529421 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3444 :
            {
                if ( 
listitem 19 ) return ShowPlayerDefaultDialogplayerid );
                
                new
                    
model_array[] = { 602429496402541415589587565494502503411559603475506451558477 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3445 :
            {
                if ( 
listitem ) return ShowPlayerDefaultDialogplayerid );
                new
                    
model_array[] = { 418404479458561 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3446 :
            {
                if ( 
listitem ) return ShowPlayerDefaultDialogplayerid );
                
                new
                    
model_array[] = { 472473493595484430453452446454 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3447 :
            {
                if ( 
listitem 11 ) return ShowPlayerDefaultDialogplayerid );
                new
                    
model_array[] = { 435450591606607610569590584570608611 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3448 :
            {
                if ( 
listitem 23 ) return ShowPlayerDefaultDialogplayerid );
                
                new
                    
model_array[] = { 485537457483508532486406530538434545588571572423442428409574449525583539 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
            case 
3449 :
            {
                if ( 
listitem ) return ShowPlayerDefaultDialogplayerid );
            
                new
                    
model_array[] = { 441464465501564594 };
                return 
CreatePlayerVehicleplayeridmodel_arraylistitem ] );
            }
        }
    }
    return 
0;

tem coisas erradas ai..
Reply
#3

como eu disse ,esse sistema nгo й meu por isso nгo entendo muito,esses "ifs" ai pelo que eu vi esses FS й do 0.3a
:S

mas tenta me ajudar por favor :S
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)