Sistema de Concessionaria v2.0 Final
Olá pessoal. Estou disponibilizando a versão v2.0 Final do meu sistema de Concessionaria.
Esta é a versão final , só ocorrerá atualizações nos Bugs !
As outras atualizações serão feitas por mim e estarão comigo , e não serão disponibilizadas.
Comandos:
/comprarcarro - Efetua a compra de algum veiculo
/vendercarro - Efetua a venda do seu veiculo. No caso , vende o seu veiculo por 50% do valor comprado.
/estacionar - Estacionar o seu veiculo na posição que você deseja.
/pintar - Pinta o seu veiculo em uma determinada cor. ( Não fiz o sistema de salvamento :S )
/localizarcarro - Localiza onde o seu veiculo está.
/ajudacarro - Mostra os comandos acima. /\
Como funciona?
Essa atualização vai além da antiga. Nesse sistema , você digita apenas o comando de compra de veiculo e escolhe o veiculo que deseja. Neste caso , alguns veiculos 'RP´s' , no caso os veiculos terrestres , foram escolhidos por mim para ser vendidos. -q
Veja o video abaixo de compra de veiculo xD
Video
Download
concessionaria v2.0 final.pwn
Creditos Estara Dentro Do Video
Olá pessoal. Estou disponibilizando a versão v2.0 Final do meu sistema de Concessionaria.
Esta é a versão final , só ocorrerá atualizações nos Bugs !
As outras atualizações serão feitas por mim e estarão comigo , e não serão disponibilizadas.
Comandos:
/comprarcarro - Efetua a compra de algum veiculo
/vendercarro - Efetua a venda do seu veiculo. No caso , vende o seu veiculo por 50% do valor comprado.
/estacionar - Estacionar o seu veiculo na posição que você deseja.
/pintar - Pinta o seu veiculo em uma determinada cor. ( Não fiz o sistema de salvamento :S )
/localizarcarro - Localiza onde o seu veiculo está.
/ajudacarro - Mostra os comandos acima. /\
Como funciona?
Essa atualização vai além da antiga. Nesse sistema , você digita apenas o comando de compra de veiculo e escolhe o veiculo que deseja. Neste caso , alguns veiculos 'RP´s' , no caso os veiculos terrestres , foram escolhidos por mim para ser vendidos. -q
Veja o video abaixo de compra de veiculo xD
Video
Download
- Código:
/*
>>>>>>>>>>>>>>>>>>>>>>>>>>>> Créditos :
[]BlackGangsta[] - Idealizador e Criador
Josma_CMD - Ajudante - Ajudou em varias coisas no FilterScript
*/
#include < a_samp >
#include < Dini >
enum iCarro
{
s_Dono[ 24 ],
s_Modelo,
Float:s_PosX,
Float:s_PosY,
Float:s_PosZ,
Float:s_PosA,
s_Cor1,
s_Cor2,
s_Respawn
};
new
InfoCarro [ MAX_PLAYERS ] [ iCarro ] ,
CarroJogador [ MAX_PLAYERS ] ,
String [ 128 ] ,
Checkpoint [ MAX_PLAYERS ] ,
NomeCarro [ MAX_PLAYERS ] ,
CarroJogadorEntrar [ MAX_PLAYERS ]
;
new NomeVeiculos[212][] =
{
"400 - Landstalker", "401 - Bravura", "402 - Buffalo", "403 - Linerunner", "404 - Pereniel", "405 - Sentinel", "406 - Dumper", "407 - Firetruck", "408 - Trashmaster", "409 - Stretch",
"410 - Manana", "411 - Infernus", "412 - Voodoo", "413 - Pony", "414 - Mule", "415 - Cheetah", "416 - Ambulance", "417 - Leviathan", "418 - Moonbeam", "419 - Esperanto", "420 - Taxi",
"421 - Washington", "422 - Bobcat", "423 - Mr Whoopee", "424 - BF Injection", "425 - Hunter", "426 - Premier", "427 - Enforcer", "428 - Securicar", "429 - Banshee", "430 - Predator",
"431 - Bus", "432 - Rhino", "433 - Barracks", "434 - Hotknife", "435 - Trailer", "436 - Previon", "437 - Coach", "438 - Cabbie", "439 - Stallion", "440 - Rumpo", "441 - RC Bandit", "442 - Romero",
"443 - Packer", "444 - Monster", "445 - Admiral", "446 - Squalo", "447 - Seasparrow", "448 - Pizzaboy", "449 - Tram", "450 - Trailer", "451 - Turismo", "452 - Speeder", "453 - Reefer", "454 - Tropic", "455 - Flatbed",
"456 - Yankee", "457 - Caddy", "458 - Solair", "459 - Berkley's RC Van", "460 - Skimmer", "461 - PCJ-600", "462 - Faggio", "463 - Freeway", "464 - RC Baron", "465 - RC Raider",
"466 - Glendale", "467 - Oceanic", "468 - Sanchez", "469 - Sparrow", "470 - Patriot", "471 - Quad", "472 - Coastguard", "473 - Dinghy", "474 - Hermes", "475 - Sabre", "476 - Rustler",
"477 - ZR350", "478 - Walton", "479 - Regina", "480 - Comet", "481 - BMX", "482 - Burrito", "483 - Camper", "484 - Marquis", "485 - Baggage", "486 - Dozer", "487 - Maverick", "488 - News Chopper",
"489 - Rancher", "490 - FBI Rancher", "491 - Virgo", "492 - Greenwood", "493 - Jetmax", "494 - Hotring", "495 - Sandking", "496 - Blista Compact", "497 - Police Maverick",
"498 - Boxville", "499 - Benson", "500 - Mesa", "501 - RC Goblin", "502 - Hotring Racer", "503 - Hotring Racer", "504 - Bloodring Banger", "505 - Rancher", "506 - Super GT",
"507 - Elegant", "508 - Journey", "509 - Bike", "510 - Mountain Bike", "511 - Beagle", "512 - Cropdust", "513 - Stunt", "514 - Tanker", "515 - RoadTrain", "516 - Nebula", "517 - Majestic",
"518 - Buccaneer", "519 - Shamal", "520 - Hydra", "521 - FCR-900", "522 - NRG-500", "523 - HPV1000", "524 - Cement Truck", "525 - Tow Truck", "526 - Fortune", "527 - Cadrona", "528 - FBI Truck",
"529 - Willard", "530 - Forklift", "531 - Tractor", "532 - Combine", "533 - Feltzer", "534 - Remington", "535 - Slamvan", "536 - Blade", "537 - Freight", "538 - Streak", "539 - Vortex", "540 - Vincent",
"541 - Bullet", "542 - Clover", "543 - Sadler", "544 - Firetruck", "545 - Hustler", "546 - Intruder", "547 - Primo", "548 - Cargobob", "549 - Tampa", "550 - Sunrise", "551 - Merit", "552 - Utility",
"553 - Nevada", "554 - Yosemite", "555 - Windsor", "556 - Monster", "557 - Monster", "558 - Uranus", "559 - Jester", "560 - Sultan", "561 - Stratum", "562 - Elegy", "563 - Raindance", "564 - RC Tiger",
"565 - Flash", "566 - Tahoma", "567 - Savanna", "568 - Bandito", "569 - Freight", "570 - Trailer", "571 - Kart", "572 - Mower", "573 - Duneride", "574 - Sweeper", "575 - Broadway",
"576 - Tornado", "577 - AT-400", "578 - DFT-30", "579 - Huntley", "580 - Stafford", "581 - BF-400", "582 - Newsvan", "583 - Tug", "584 - Trailer", "585 - Emperor", "586 - Wayfarer",
"587 - Euros", "588 - Hotdog", "589 - Club", "590 - Trailer", "591 - Trailer", "592 - Andromada", "593 - Dodo", "594 - RC Cam", "595 - Launch", "596 - Police Car (LSPD)", "597 - Police Car (SFPD)",
"598 - Police Car (LVPD)", "599 - Police Ranger", "600 - Picador", "601 - S.W.A.T. Van", "602 - Alpha", "603 - Phoenix", "604 - Glendale", "605 - Sadler", "606 - Luggage Trailer A",
"607 - Luggage Trailer B", "608 - Stair Trailer", "609 - Boxville", "610 - Farm Plow", "611 - Utility Trailer"
};
enum iVenda {ModeloCarro,PrecoCarro};
new
InfoVenda[103][iVenda] =
{
{400 , 50000} ,
{401 , 35000} ,
{402 , 100000} ,
{403 , 120000} ,
{404 , 20000} ,
{405 , 35000} ,
{409 , 150000} ,
{410 , 15000} ,
{411 , 400000} ,
{412 , 25000} ,
{415 , 200000} ,
{418 , 20000} ,
{419 , 20000} ,
{421 , 25000} ,
{422 , 15000} ,
{424 , 10000} ,
{426 , 30000} ,
{429 , 200000} ,
{434 , 25000} ,
{436 , 12000} ,
{439 , 12000} ,
{445 , 18000} ,
{451 , 450000} ,
{457 , 10000} ,
{458 , 18000} ,
{461 , 8000} ,
{462 , 5000} ,
{463 , 13000} ,
{466 , 15000} ,
{467 , 18000} ,
{468 , 15000} ,
{471 , 10000} ,
{474 , 25000} ,
{475 , 30000} ,
{477 , 40000} ,
{478 , 8000} ,
{479 , 14000} ,
{480 , 50000} ,
{481 , 500} ,
{483 , 16000} ,
{489 , 27000} ,
{491 , 17000} ,
{492 , 19000} ,
{495 , 32000} ,
{496 , 25000} ,
{500 , 29000} ,
{502 , 500000} ,
{505 , 27000} ,
{506 , 80000} ,
{507 , 22000} ,
{508 , 30000} ,
{509 , 500} ,
{510 , 13000} ,
{514 , 60000} ,
{515 , 60000} ,
{516 , 20000} ,
{517 , 15000} ,
{518 , 17500} ,
{521 , 70000} ,
{522 , 100000} ,
{526 , 20000} ,
{527 , 20000} ,
{529 , 22000} ,
{533 , 23500} ,
{534 , 32000} ,
{535 , 35000} ,
{536 , 35000} ,
{540 , 32700} ,
{541 , 350000} ,
{542 , 28000} ,
{543 , 20000} ,
{545 , 20000} ,
{546 , 28000} ,
{547 , 27000} ,
{549 , 22000} ,
{550 , 35000} ,
{551 , 32000} ,
{554 , 25000} ,
{555 , 20000} ,
{558 , 75000} ,
{559 , 80000} ,
{560 , 100000} ,
{561 , 65000} ,
{562 , 60000} ,
{565 , 50000} ,
{566 , 30000} ,
{567 , 35000} ,
{571 , 5000} ,
{572 , 5000} ,
{575 , 13000} ,
{576 , 35000} ,
{579 , 40000} ,
{580 , 30000} ,
{581 , 38000} ,
{585 , 23500} ,
{586 , 15000} ,
{587 , 37000} ,
{589 , 30000} ,
{600 , 12000} ,
{602 , 37000} ,
{603 , 45000} ,
{604 , 7000} ,
{605 , 8000}
};
public
OnVehicleSpawn ( vehicleid )
{
for(new i ; i < MAX_PLAYERS ; ++i)
{
format ( String , 30 , "GMNovo/CarrosProprios/%s.ini" , PlayerName ( i ) ) ;
if ( fexist ( String ) )
{
if ( dini_Int ( String , "Estacionado" ) == 10 )
{
SetVehiclePos ( vehicleid , dini_Int ( String , "PosX" ) , dini_Int ( String , "PosY" ) , dini_Int ( String , "PosZ" ) ) ;
}
}
}
return true ;
}
public
OnGameModeExit ( )
{
SetTimer ( "GameModeExitFunc" , 2000 , 0 ) ;
return true ;
}
public
OnPlayerConnect ( playerid )
{
format ( String , sizeof ( String ) , "GMNovo/CarrosProprios/%s.ini" , PlayerName ( playerid ) ) ;
if ( dini_Exists ( String ) )
{
InfoCarro[ playerid ] [ s_Dono ] = dini_Int ( String , "DonoCarro" ) ;
InfoVenda[ playerid ] [ ModeloCarro ] = dini_Int ( String , "Modelo" ) ;
InfoCarro[ playerid ] [ s_PosX ] = dini_Float ( String , "PosX" ) ;
InfoCarro[ playerid ] [ s_PosY ] = dini_Float ( String , "PosY" ) ;
InfoCarro[ playerid ] [ s_PosZ ] = dini_Float ( String , "PosZ" ) ;
InfoCarro[ playerid ] [ s_PosA ] = dini_Float ( String , "Angulo" ) ;
InfoCarro[ playerid ] [ s_Cor1 ] = dini_Int ( String , "Cor1" ) ;
InfoCarro[ playerid ] [ s_Cor2 ] = dini_Int ( String , "Cor2" ) ;
InfoCarro[ playerid ] [ s_Respawn ] = dini_Int ( String , "Respawn" ) ;
CarroJogador [ playerid ] = CreateVehicle ( InfoVenda[ playerid ] [ ModeloCarro ] , InfoCarro[ playerid ] [ s_PosX ] , InfoCarro[ playerid ] [ s_PosY ] , InfoCarro[ playerid ] [ s_PosZ ] , InfoCarro[ playerid ] [ s_PosA ] , InfoCarro[ playerid ] [ s_Cor1 ] , InfoCarro[ playerid ] [ s_Cor2 ] , InfoCarro[ playerid ] [ s_Respawn ] ) ;
}
return true ;
}
public
OnPlayerSpawn ( playerid )
return SetPlayerPos ( playerid , 1691.1439 , 1430.6595 , 10.7658 ) ;
public
OnPlayerDisconnect ( playerid , reason )
{
format ( String , sizeof ( String ) , "GMNovo/CarrosProprios/%s.ini" , PlayerName ( playerid ) ) ;
if ( dini_Exists ( String ) )
{
dini_IntSet ( String , "Preço" , InfoVenda [ playerid ] [ PrecoCarro ] ) ;
dini_IntSet ( String , "Modelo" , InfoVenda [ playerid ] [ ModeloCarro ] ) ;
dini_FloatSet ( String , "PosX" , InfoCarro [ playerid ] [ s_PosX ] ) ;
dini_FloatSet ( String , "PosY" , InfoCarro [ playerid ] [ s_PosY ] ) ;
dini_FloatSet ( String , "PosZ" , InfoCarro [ playerid ] [ s_PosZ ] ) ;
dini_FloatSet ( String , "Angulo" , InfoCarro [ playerid ] [ s_PosA ] ) ;
dini_IntSet ( String , "Cor1" , 1 ) ;
dini_IntSet ( String , "Cor2" , 1 ) ;
dini_IntSet ( String , "Respawn" , -1 ) ;
DestroyVehicle ( CarroJogador [ playerid ] ) ;
}
return true ;
}
public
OnPlayerEnterCheckpoint ( playerid )
{
if ( Checkpoint [ playerid ] == 1 )
{
PlayerPlaySound ( playerid , 1149 , 0.0 , 0.0 , 0.0 ) ;
SendClientMessage ( playerid , -1 , "Seja Bem Vindo ao seu veiculo !" ) ;
DisablePlayerCheckpoint ( playerid ) ;
return true;
}
return true;
}
public
OnPlayerCommandText ( playerid , cmdtext[] )
{
new
cmd [ 128 ] ,
tmp [ 128 ] ,
tmp2 ,
idx,
msg [ 128 ]
;
cmd = strtok ( cmdtext , idx ) ;
tmp = strtok ( cmdtext , idx ) ;
tmp2 = strval ( tmp ) ;
format ( String , sizeof ( String ) , "GMNovo/CarrosProprios/%s.ini" , PlayerName ( playerid ) ) ;
if ( strcmp ( "/comprarcarro" , cmdtext ) == 0 )
{
if ( dini_Exists ( String ) )
return SendClientMessage ( playerid , -1 , "Você já possui um veiculo !" ) ;
ShowPlayerDialog ( playerid , 120+119, DIALOG_STYLE_INPUT, "Carros","Escreva o nome do veiculo que você deseja.","Certo","Cancelar");
return true;
}
if ( strcmp ("/vendercarro" , cmdtext ) == 0 )
{
if (! dini_Exists ( String ) )
return SendClientMessage ( playerid , -1 , "Você não possui um veiculo !" ) ;
if ( ! IsPlayerInVehicle ( playerid , CarroJogador [ playerid ] ) )
return SendClientMessage ( playerid , 0xFFFFFFAA , "Você não está em seu veiculo." ) ;
format(msg, sizeof(msg), "Você vendeu seu carro por um valor 50 por cento, para $ %i.", InfoVenda [ playerid ] [ PrecoCarro ] / 2 ) ;
GivePlayerMoney ( playerid , InfoVenda [ playerid ] [ PrecoCarro ] / 2 ) ;
DestroyVehicle ( CarroJogador [ playerid ] ) ;
dini_Remove ( String ) ;
CarroJogador [ playerid ] = 0 ;
InfoVenda [ playerid ] [ ModeloCarro ] = 0 ;
InfoVenda [ playerid ] [ PrecoCarro ] = 0 ;
InfoCarro [ playerid ] [ s_PosX ] = 0 ;
InfoCarro [ playerid ] [ s_PosY ] = 0 ;
InfoCarro [ playerid ] [ s_PosZ ] = 0 ;
InfoCarro [ playerid ] [ s_PosA ] = 0 ;
SendClientMessage ( playerid , 0xFFFF00FF , msg ) ;
return 1;
}
if ( strcmp ( "/estacionar" , cmdtext ) == 0 )
{
if ( ! IsPlayerInVehicle ( playerid , CarroJogador [ playerid ] ) )
return SendClientMessage ( playerid , 0xFFFFFFAA , "Você não está no seu veiculo." ) ;
AtualizarPos ( ) ;
InfoVenda [ playerid ] [ ModeloCarro ] = GetVehicleModel ( GetPlayerVehicleID ( playerid ) ) ;
InfoCarro [ playerid ] [ s_PosX ] = GetPVarFloat ( playerid , "PosX" ) ;
InfoCarro [ playerid ] [ s_PosY ] = GetPVarFloat ( playerid , "PosY" ) ;
InfoCarro [ playerid ] [ s_PosZ ] = GetPVarFloat ( playerid , "PosZ" ) ;
InfoCarro [ playerid ] [ s_PosA ] = GetPVarFloat ( playerid , "PosA" ) ;
printf ( "PosX: %f, PosY: %f, PosZ: %f, PosA: %f" , GetPVarFloat ( playerid , "PosX" ) , GetPVarFloat ( playerid , "PosY" ) , GetPVarFloat ( playerid , "PosZ" ) , GetPVarFloat ( playerid , "PosA" ) ) ;
SendClientMessage ( playerid , 0xFFFF00FF , "Carro estacionado com sucesso !" ) ;
return true;
}
if ( strcmp ( "/localizarcarro" , cmdtext ) == 0 )
{
new
Float:vx ,
Float:vy ,
Float:vz
;
GetVehiclePos ( CarroJogador [ playerid ] , vx , vy , vz ) ;
SetPlayerCheckpoint ( playerid , vx , vy , vz , 10.0 ) ;
Checkpoint [ playerid ] = 1 ;
SendClientMessage ( playerid , 0xFFFFFFAA , "Vá ate o Checkpoint para Localizar o seu carro !" ) ;
return true;
}
if ( strcmp ( cmd , "/pintar" , true ) == 0 )
{
if ( ! dini_Exists ( String ) )
return SendClientMessage ( playerid , -1 , "Você não possui um veiculo !" ) ;
if ( ! IsPlayerInVehicle ( playerid , CarroJogador [ playerid ] ) )
return SendClientMessage ( playerid , 0xFFFFFFAA , "Você não está no seu veiculo." ) ;
if ( ! strlen ( tmp ) )
return SendClientMessage ( playerid , -1 , "Use /pintar [ Cor ]" ) ;
ChangeVehicleColor ( GetPlayerVehicleID ( playerid ) , tmp2 , tmp2 ) ;
format ( String , sizeof ( String ) , "Voce Mudou a Cor do seu veiculo para : %i" , tmp2 ) ;
SendClientMessage ( playerid , -1 , String ) ;
return 1;
}
if ( strcmp ( "/ajudacarro" , cmdtext ) == 0 )
{
SendClientMessage ( playerid , 0xCBCCCEFF, "*** CARRO *** /estacionar /vendercarro /localizarcarro /pintar");
return true;
}
if ( strcmp ( cmdtext , "/testarpos" , true ) == 0 )
{
AtualizarPos ( ) ;
printf ( "PosX: %f, PosY: %f, PosZ: %f, PosA: %f" , GetPVarFloat ( playerid , "PosX" ) , GetPVarFloat ( playerid , "PosY" ) , GetPVarFloat ( playerid , "PosZ" ) , GetPVarFloat ( playerid , "PosA" ) ) ;
return true ;
}
return false;
}
public
OnPlayerStateChange(playerid, newstate, oldstate)
{
if ( newstate == PLAYER_STATE_DRIVER )
{
if ( CarroJogador [ playerid ] == GetPlayerVehicleID ( playerid ) )
{
new
owner [ MAX_PLAYER_NAME ]
;
GetPlayerName ( InfoCarro [ playerid ] [ s_Dono ] , owner , sizeof ( owner ) ) ;
format ( String , sizeof ( String ) , "Este(a) \"%s\" pertence a %s." , GetVehicleNameFromID ( GetPlayerVehicleID ( playerid ) ) , owner ) ;
SendClientMessage ( playerid , 0xFFFFFFAA , String ) ;
}
}
else if ( newstate == PLAYER_STATE_DRIVER )
{
if ( CarroJogador [ playerid ] != GetPlayerVehicleID ( playerid ) )
{
format ( String, sizeof ( String ) , "Veículo de %s somente ele(a) pode dirigi-lo!" , InfoCarro[ playerid ] [ s_Dono ] ) ;
SendClientMessage ( playerid , -1 , String ) ;
PlayerPlaySound ( playerid , 1147 , 0.0 , 0.0 , 0.0) ;
RemovePlayerFromVehicle ( playerid ) ;
}
}
return true;
}
public
OnDialogResponse ( playerid , dialogid , response , listitem , inputtext[] )
{
if ( dialogid == 120+119 )
{
if ( response )
{
new
Float:X ,
Float:Y ,
Float:Z
;
NomeCarro [ playerid ] = GetarNomeCarros ( inputtext ) ;
GetPlayerPos ( playerid , X , Y , Z ) ;
CarroJogadorEntrar [ playerid ] = CreateVehicle ( NomeCarro [ playerid ] , X , Y , Z , 180 , -1 , -1 , -1 ) ;
PutPlayerInVehicle ( playerid , CarroJogadorEntrar [ playerid ] , 0 ) ;
if(!GetVehicleBuy(CarroJogadorEntrar[playerid]))
return SendClientMessage ( playerid, -1 , "[ERRO] Veiculo Invalido !" ) , DestroyVehicle ( CarroJogadorEntrar [ playerid ] ) ;
new
stringdois [ 128 ]
;
format(stringdois, sizeof(stringdois), "Você deseja comprar um %s por %d ?", GetVehicleNameFromID(GetPlayerVehicleID(playerid)), RetornarCarro ( playerid ) );
ShowPlayerDialog ( playerid , 120+121 , DIALOG_STYLE_MSGBOX , "Compra de Veiculo" , stringdois , "Sim" , "Não" ) ;
}
return true;
}
if ( dialogid == 120+121 )
{
if(response)
{
if ( GetPlayerMoney ( playerid ) < InfoVenda [ playerid ] [ PrecoCarro ] )
return SendClientMessage ( playerid , -1 , "Você não tem dinheiro suficiente !" ) ,DestroyVehicle ( CarroJogadorEntrar [ playerid ] ) , TogglePlayerControllable ( playerid , true ) ;
SetPlayerPos ( playerid , 1699.2 , 1435.1 , 10.7 ) ;
new
Float:x_set ,
Float:y_set ,
Float:z_set ,
Float:a_set
;
GetPlayerPos( playerid, x_set, y_set, z_set ) ;
GetPlayerFacingAngle( playerid, a_set ) ;
format( String , sizeof ( String ) , "GMNovo/CarrosProprios/%s.ini" , PlayerName ( playerid ) ) ;
DestroyVehicle ( CarroJogadorEntrar [ playerid ] ) ;
if(! dini_Create ( String ) ) return dini_Create ( String ) ;
CarroJogador [ playerid ] = CreateVehicle ( NomeCarro [ playerid ] , 1699.2 , 1435.1 , 10.7 , a_set , 1 , 1, -1 ) ;
PutPlayerInVehicle ( playerid , CarroJogador [ playerid ] , 0 ) ;
dini_Set ( String , "DonoCarro" , PlayerName ( playerid ) ) ;
dini_IntSet ( String , "Preço" , InfoVenda [ playerid ] [ PrecoCarro ] ) ;
dini_IntSet ( String , "Modelo" , GetVehicleModel ( CarroJogador [ playerid ] ) ) ;
dini_FloatSet ( String , "PosX" , x_set ) ;
dini_FloatSet ( String , "PosY" , y_set ) ;
dini_FloatSet ( String , "PosZ" , z_set ) ;
dini_FloatSet ( String , "Angulo" , a_set ) ;
dini_IntSet ( String , "Cor1" , 1 ) ;
dini_IntSet ( String , "Cor2" , 1 ) ;
dini_IntSet ( String , "Respawn" , -1 ) ;
format( InfoCarro[ GetPlayerVehicleID ( playerid ) ][ s_Dono ], 24, dini_Get( String, "DonoCarro" ));
InfoCarro[ playerid ] [ s_Dono ] = dini_Int ( String , "DonoCarro" ) ;
InfoVenda[ playerid ] [ ModeloCarro ] = dini_Int ( String , "Modelo" ) ;
InfoCarro[ playerid ] [ s_PosX ] = dini_Float ( String , "PosX" ) ;
InfoCarro[ playerid ] [ s_PosY ] = dini_Float ( String , "PosY" ) ;
InfoCarro[ playerid ] [ s_PosZ ] = dini_Float ( String , "PosZ" ) ;
InfoCarro[ playerid ] [ s_PosA ] = dini_Float ( String , "Angulo" ) ;
InfoCarro[ playerid ] [ s_Cor1 ] = dini_Int ( String , "Cor1" ) ;
InfoCarro[ playerid ] [ s_Cor2 ] = dini_Int ( String , "Cor2" ) ;
InfoCarro[ playerid ] [ s_Respawn ] = dini_Int ( String , "Respawn" ) ;
RemovePlayerFromVehicle ( playerid ) ;
TogglePlayerControllable ( playerid , true ) ;
}
else
{
DestroyVehicle ( CarroJogadorEntrar [ playerid ] ) ;
TogglePlayerControllable ( playerid , true ) ;
}
}
return true;
}
forward RetornarCarro ( playerid ) ;
public
RetornarCarro ( playerid )
{
switch ( GetVehicleModel ( GetPlayerVehicleID ( playerid ) ) )
{
case 400: InfoVenda [ playerid ] [ PrecoCarro ] = 50000;
case 401: InfoVenda [ playerid ] [ PrecoCarro ] = 35000;
case 402: InfoVenda [ playerid ] [ PrecoCarro ] = 100000;
case 403: InfoVenda [ playerid ] [ PrecoCarro ] = 120000;
case 404: InfoVenda [ playerid ] [ PrecoCarro ] = 20000;
case 405: InfoVenda [ playerid ] [ PrecoCarro ] = 35000;
case 409: InfoVenda [ playerid ] [ PrecoCarro ] = 150000;
case 410: InfoVenda [ playerid ] [ PrecoCarro ] = 15000;
case 411: InfoVenda [ playerid ] [ PrecoCarro ] = 400000;
case 412: InfoVenda [ playerid ] [ PrecoCarro ] = 25000;
case 415: InfoVenda [ playerid ] [ PrecoCarro ] = 200000;
case 418: InfoVenda [ playerid ] [ PrecoCarro ] = 20000;
case 419: InfoVenda [ playerid ] [ PrecoCarro ] = 20000;
case 421: InfoVenda [ playerid ] [ PrecoCarro ] = 25000;
case 422: InfoVenda [ playerid ] [ PrecoCarro ] = 15000;
case 424: InfoVenda [ playerid ] [ PrecoCarro ] = 10000;
case 426: InfoVenda [ playerid ] [ PrecoCarro ] = 30000;
case 429: InfoVenda [ playerid ] [ PrecoCarro ] = 200000;
case 434: InfoVenda [ playerid ] [ PrecoCarro ] = 25000;
case 436: InfoVenda [ playerid ] [ PrecoCarro ] = 12000;
case 439: InfoVenda [ playerid ] [ PrecoCarro ] = 12000;
case 445: InfoVenda [ playerid ] [ PrecoCarro ] = 18000;
case 451: InfoVenda [ playerid ] [ PrecoCarro ] = 450000;
case 457: InfoVenda [ playerid ] [ PrecoCarro ] = 10000;
case 458: InfoVenda [ playerid ] [ PrecoCarro ] = 18000;
case 461: InfoVenda [ playerid ] [ PrecoCarro ] = 8000;
case 462: InfoVenda [ playerid ] [ PrecoCarro ] = 5000;
case 463: InfoVenda [ playerid ] [ PrecoCarro ] = 13000;
case 466: InfoVenda [ playerid ] [ PrecoCarro ] = 15000;
case 467: InfoVenda [ playerid ] [ PrecoCarro ] = 18000;
case 468: InfoVenda [ playerid ] [ PrecoCarro ] = 15000;
case 471: InfoVenda [ playerid ] [ PrecoCarro ] = 10000;
case 474: InfoVenda [ playerid ] [ PrecoCarro ] = 25000;
case 475: InfoVenda [ playerid ] [ PrecoCarro ] = 30000;
case 477: InfoVenda [ playerid ] [ PrecoCarro ] = 40000;
case 478: InfoVenda [ playerid ] [ PrecoCarro ] = 8000;
case 479: InfoVenda [ playerid ] [ PrecoCarro ] = 14000;
case 480: InfoVenda [ playerid ] [ PrecoCarro ] = 50000;
case 481: InfoVenda [ playerid ] [ PrecoCarro ] = 500;
case 483: InfoVenda [ playerid ] [ PrecoCarro ] = 16000;
case 489: InfoVenda [ playerid ] [ PrecoCarro ] = 27000;
case 491: InfoVenda [ playerid ] [ PrecoCarro ] = 17000;
case 492: InfoVenda [ playerid ] [ PrecoCarro ] = 19000;
case 495: InfoVenda [ playerid ] [ PrecoCarro ] = 32000;
case 496: InfoVenda [ playerid ] [ PrecoCarro ] = 25000;
case 500: InfoVenda [ playerid ] [ PrecoCarro ] = 29000;
case 502: InfoVenda [ playerid ] [ PrecoCarro ] = 500000;
case 505: InfoVenda [ playerid ] [ PrecoCarro ] = 27000;
case 506: InfoVenda [ playerid ] [ PrecoCarro ] = 80000;
case 507: InfoVenda [ playerid ] [ PrecoCarro ] = 22000;
case 508: InfoVenda [ playerid ] [ PrecoCarro ] = 30000;
case 509: InfoVenda [ playerid ] [ PrecoCarro ] = 500;
case 510: InfoVenda [ playerid ] [ PrecoCarro ] = 13000;
case 514: InfoVenda [ playerid ] [ PrecoCarro ] = 60000;
case 515: InfoVenda [ playerid ] [ PrecoCarro ] = 60000;
case 516: InfoVenda [ playerid ] [ PrecoCarro ] = 20000;
case 517: InfoVenda [ playerid ] [ PrecoCarro ] = 15000;
case 518: InfoVenda [ playerid ] [ PrecoCarro ] = 17500;
case 521: InfoVenda [ playerid ] [ PrecoCarro ] = 70000;
case 522: InfoVenda [ playerid ] [ PrecoCarro ] = 100000;
case 526: InfoVenda [ playerid ] [ PrecoCarro ] = 20000;
case 527: InfoVenda [ playerid ] [ PrecoCarro ] = 20000;
case 529: InfoVenda [ playerid ] [ PrecoCarro ] = 22000;
case 533: InfoVenda [ playerid ] [ PrecoCarro ] = 23500;
case 534: InfoVenda [ playerid ] [ PrecoCarro ] = 32000;
case 535: InfoVenda [ playerid ] [ PrecoCarro ] = 35000;
case 536: InfoVenda [ playerid ] [ PrecoCarro ] = 35000;
case 540: InfoVenda [ playerid ] [ PrecoCarro ] = 32700;
case 541: InfoVenda [ playerid ] [ PrecoCarro ] = 350000;
case 542: InfoVenda [ playerid ] [ PrecoCarro ] = 28000;
case 543: InfoVenda [ playerid ] [ PrecoCarro ] = 20000;
case 545: InfoVenda [ playerid ] [ PrecoCarro ] = 20000;
case 546: InfoVenda [ playerid ] [ PrecoCarro ] = 28000;
case 547: InfoVenda [ playerid ] [ PrecoCarro ] = 27000;
case 549: InfoVenda [ playerid ] [ PrecoCarro ] = 22000;
case 550: InfoVenda [ playerid ] [ PrecoCarro ] = 35000;
case 551: InfoVenda [ playerid ] [ PrecoCarro ] = 32000;
case 554: InfoVenda [ playerid ] [ PrecoCarro ] = 25000;
case 555: InfoVenda [ playerid ] [ PrecoCarro ] = 20000;
case 558: InfoVenda [ playerid ] [ PrecoCarro ] = 75000;
case 559: InfoVenda [ playerid ] [ PrecoCarro ] = 80000;
case 560: InfoVenda [ playerid ] [ PrecoCarro ] = 100000;
case 561: InfoVenda [ playerid ] [ PrecoCarro ] = 65000;
case 562: InfoVenda [ playerid ] [ PrecoCarro ] = 60000;
case 565: InfoVenda [ playerid ] [ PrecoCarro ] = 50000;
case 566: InfoVenda [ playerid ] [ PrecoCarro ] = 30000;
case 567: InfoVenda [ playerid ] [ PrecoCarro ] = 35000;
case 571: InfoVenda [ playerid ] [ PrecoCarro ] = 5000;
case 572: InfoVenda [ playerid ] [ PrecoCarro ] = 5000;
case 575: InfoVenda [ playerid ] [ PrecoCarro ] = 13000;
case 576: InfoVenda [ playerid ] [ PrecoCarro ] = 35000;
case 579: InfoVenda [ playerid ] [ PrecoCarro ] = 40000;
case 580: InfoVenda [ playerid ] [ PrecoCarro ] = 30000;
case 581: InfoVenda [ playerid ] [ PrecoCarro ] = 38000;
case 585: InfoVenda [ playerid ] [ PrecoCarro ] = 23500;
case 586: InfoVenda [ playerid ] [ PrecoCarro ] = 15000;
case 587: InfoVenda [ playerid ] [ PrecoCarro ] = 37000;
case 589: InfoVenda [ playerid ] [ PrecoCarro ] = 30000;
case 600: InfoVenda [ playerid ] [ PrecoCarro ] = 12000;
case 602: InfoVenda [ playerid ] [ PrecoCarro ] = 37000;
case 603: InfoVenda [ playerid ] [ PrecoCarro ] = 45000;
case 604: InfoVenda [ playerid ] [ PrecoCarro ] = 7000;
case 605: InfoVenda [ playerid ] [ PrecoCarro ] = 8000;
}
return InfoVenda [ playerid ] [ PrecoCarro ];
}
forward AtualizarPos ( ) ;
public
AtualizarPos ( )
{
for ( new i ; i < MAX_PLAYERS ; i ++ )
{
if ( ! IsPlayerConnected ( i ) ) continue ;
new
Float:JK [ 4 ]
;
GetPlayerPos ( i , JK [ 0 ] , JK [ 1 ] , JK [ 2 ] ) ;
GetPlayerFacingAngle ( i , JK [ 3 ] ) ;
SetPVarFloat ( i , "PosX" , JK [ 0 ] ) ;
SetPVarFloat ( i , "PosY" , JK [ 1 ] ) ;
SetPVarFloat ( i , "PosZ" , JK [ 2 ] ) ;
SetPVarFloat ( i , "PosA" , JK [ 3 ] ) ;
}
return true ;
}
forward GameModeExitFunc ( playerid ) ;
public
GameModeExitFunc ( playerid )
{
format ( String , sizeof ( String ) , "GMNovo/CarrosProprios/%s.ini" , PlayerName ( playerid ) ) ;
if ( dini_Exists ( String ) )
{
dini_IntSet ( String , "Preço" , InfoVenda [ playerid ] [ PrecoCarro ] ) ;
dini_IntSet ( String , "Modelo" , InfoVenda [ playerid ] [ ModeloCarro ] ) ;
dini_FloatSet ( String , "PosX" , InfoCarro [ playerid ] [ s_PosX ] ) ;
dini_FloatSet ( String , "PosY" , InfoCarro [ playerid ] [ s_PosY ] ) ;
dini_FloatSet ( String , "PosZ" , InfoCarro [ playerid ] [ s_PosZ ] ) ;
dini_FloatSet ( String , "Angulo" , InfoCarro [ playerid ] [ s_PosA ] ) ;
dini_IntSet ( String , "Cor1" , InfoCarro [ playerid ] [ s_Cor1 ] ) ;
dini_IntSet ( String , "Cor2" , InfoCarro [ playerid ] [ s_Cor2 ] ) ;
dini_IntSet ( String , "Respawn" , InfoCarro [ playerid ] [ s_Respawn ] ) ;
DestroyVehicle ( CarroJogador [ playerid ] ) ;
}
return true;
}
stock
PlayerName ( playerid )
{
new Nome [ MAX_PLAYER_NAME ] ;
GetPlayerName ( playerid , Nome , sizeof ( Nome ) ) ;
return Nome;
}
strtok(const string[], &index)
{
new length = strlen(string);
while((index < length) &&(string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while((index < length) &&(string[index] > ' ') &&((index - offset) <(sizeof(result) - 1)) )
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
stock
GetVehicleNameFromID(vehicleid)
{
static const scVehicleNames [ ] [ 18 ] = {
"Landstalker",
"Bravura",
"Buffalo",
"Linerunner",
"Perrenial",
"Sentinel",
"Dumper",
"Firetruck",
"Trashmaster",
"Stretch",
"Manana",
"Infernus",
"Voodoo",
"Pony",
"Mule",
"Cheetah",
"Ambulance",
"Leviathan",
"Moonbeam",
"Esperanto",
"Taxi",
"Washington",
"Bobcat",
"Mr Whoopee",
"BF Injection",
"Hunter",
"Premier",
"Enforcer",
"Securicar",
"Banshee",
"Predator",
"Bus",
"Rhino",
"Barracks",
"Hotknife",
"Trailer 1",
"Previon",
"Coach",
"Cabbie",
"Stallion",
"Rumpo",
"RC Bandit",
"Romero",
"Packer",
"Monster",
"Admiral",
"Squalo",
"Seasparrow",
"Pizzaboy",
"Tram",
"Trailer 2",
"Turismo",
"Speeder",
"Reefer",
"Tropic",
"Flatbed",
"Yankee",
"Caddy",
"Solair",
"Berkley's RC Van",
"Skimmer",
"PCJ-600",
"Faggio",
"Freeway",
"RC Baron",
"RC Raider",
"Glendale",
"Oceanic",
"Sanchez",
"Sparrow",
"Patriot",
"Quad",
"Coastguard",
"Dinghy",
"Hermes",
"Sabre",
"Rustler",
"ZR-350",
"Walton",
"Regina",
"Comet",
"BMX",
"Burrito",
"Camper",
"Marquis",
"Baggage",
"Dozer",
"Maverick",
"News Chopper",
"Rancher",
"FBI Rancher",
"Virgo",
"Greenwood",
"Jetmax",
"Hotring",
"Sandking",
"Blista Compact",
"Police Maverick",
"Boxville",
"Benson",
"Mesa",
"RC Goblin",
"Hotring Racer A",
"Hotring Racer B",
"Bloodring Banger",
"Rancher",
"Super GT",
"Elegant",
"Journey",
"Bike",
"Mountain Bike",
"Beagle",
"Cropdust",
"Stunt",
"Tanker",
"Roadtrain",
"Nebula",
"Majestic",
"Buccaneer",
"Shamal",
"Hydra",
"FCR-900",
"NRG-500",
"HPV1000",
"Cement Truck",
"Tow Truck",
"Fortune",
"Cadrona",
"FBI Truck",
"Willard",
"Forklift",
"Tractor",
"Combine",
"Feltzer",
"Remington",
"Slamvan",
"Blade",
"Freight",
"Streak",
"Vortex",
"Vincent",
"Bullet",
"Clover",
"Sadler",
"Firetruck LA",
"Hustler",
"Intruder",
"Primo",
"Cargobob",
"Tampa",
"Sunrise",
"Merit",
"Utility",
"Nevada",
"Yosemite",
"Windsor",
"Monster A",
"Monster B",
"Uranus",
"Jester",
"Sultan",
"Stratum",
"Elegy",
"Raindance",
"RC Tiger",
"Flash",
"Tahoma",
"Savanna",
"Bandito",
"Freight Flat",
"Streak Carriage",
"Kart",
"Mower",
"Duneride",
"Sweeper",
"Broadway",
"Tornado",
"AT-400",
"DFT-30",
"Huntley",
"Stafford",
"BF-400",
"Newsvan",
"Tug",
"Trailer 3",
"Emperor",
"Wayfarer",
"Euros",
"Hotdog",
"Club",
"Freight Carriage",
"Trailer 3",
"Andromada",
"Dodo",
"RC Cam",
"Launch",
"LS Police Car",
"SF Police Car",
"LV Police Car",
"Police Ranger",
"Picador",
"S.W.A.T. Van",
"Alpha",
"Phoenix",
"Glendale",
"Sadler",
"Luggage Trailer A",
"Luggage Trailer B",
"Stair Trailer",
"Boxville",
"Farm Plow",
"Utility Trailer"
},
scOnFoot [ 18 ] = "OnFoot" ;
if ( vehicleid > 0 ) {
return scVehicleNames [ GetVehicleModel ( vehicleid ) - 400 ] ;
}
else {
return scOnFoot ;
}
}
GetarNomeCarros(vname[])
{
for(new i = 0; i < 211; i++)
{
if (strfind(NomeVeiculos[i], vname, true) != -1)
return i + 400;
}
return -1;
}
forward GetVehicleBuy(carid);
public GetVehicleBuy(carid)
{
new m = GetVehicleModel(carid);
if ( m == 400 || m == 401 || m == 402 ||
m == 403 || m == 404 || m == 405 || m == 409 || m == 410 ||
m == 411 || m == 412 || m == 415 || m == 418 || m == 419 ||
m == 421 || m == 422 || m == 424 || m == 426 || m == 429 ||
m == 434 || m == 436 || m == 439 || m == 445 || m == 451 ||
m == 457 || m == 458 || m == 461 || m == 462 || m == 463 ||
m == 466 || m == 467 || m == 468 || m == 471 || m == 474 ||
m == 475 || m == 477 || m == 478 || m == 479 || m == 480 ||
m == 481 || m == 483 || m == 489 || m == 491 || m == 492 ||
m == 495 || m == 496 || m == 500 || m == 502 || m == 505 ||
m == 506 || m == 507 || m == 508 || m == 509 || m == 510 ||
m == 514 || m == 515 || m == 516 || m == 517 || m == 518 ||
m == 521 || m == 522 || m == 526 || m == 527 || m == 529 ||
m == 533 || m == 534 || m == 535 || m == 536 || m == 540 ||
m == 541 || m == 542 || m == 543 || m == 545 || m == 546 ||
m == 547 || m == 549 || m == 550 || m == 551 || m == 554 ||
m == 555 || m == 558 || m == 559 || m == 560 || m == 561 ||
m == 562 || m == 565 || m == 566 || m == 567 || m == 571 ||
m == 572 || m == 575 || m == 576 || m == 579 || m == 580 ||
m == 581 || m == 585 || m == 586 || m == 587 || m == 589 ||
m == 600 || m == 602 || m == 603 || m == 604 || m == 605 )
{
return 0x01;
}
return 0;
}
concessionaria v2.0 final.pwn
Creditos Estara Dentro Do Video