Eu estou "tentando criar" uma profissгo... Petroleiro!
A... Por que vocк nгo tentou?
Sim! Eu tentei, Sу que foi para outra profissгo.. Bugou tudo! E tambйm queria que sу descarrega-se o caminhгo se o jogador estiver com a carga ID 584. Alguйm faz pra mim? Por favor!
Код:
if( !strcmp( cmd, "/descarregarp", true ))
{
if( !IsPlayerInPlace( playerid, -1869.8414, -1685.7484, 21.4771, 290.1070 ) || !IsPlayerInPlace( playerid, 2169.1951, -1980.1444, 13.2818, 266.9874 ))
{
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк nгo estб na area de descarregamento do petrуleo !" );
return 1;
}
if( GetVehicleModel( GetPlayerVehicleID( playerid )) != 514 )
{
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк nгo estб em um Roadtrain." );
return 1;
}
if( CargaP[ playerid ] == 0 )
{
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Seu caminhгo nгo estб carregado de petroleo !" );
return 1;
}
if( CarregouP[ playerid ] == 0 )
{
if( IsPlayerInPlace( playerid, 1002.5710, -940.6490, 42.1797, 92.4517 ))
{
CargaM[ playerid ] = 0;
SendClientMessage( playerid, COLOR_AMARELO, "•~~~~~~~~~~~~~~~~~[ Бrea de Descarregamento do petrуleo ]~~~~~~~~~~~~~~~~~•" );
SendClientMessage( playerid, COLOR_MINERADOR, "> Petrуleo descarregado com sucesso !" );
SendClientMessage( playerid, COLOR_MINERADOR, "> Vocк ganhou $1900 pelo petrуleo entregado com йxito !" );
SendClientMessage( playerid, COLOR_AMARELO, "•~~~~~~~~~~~~~~~~~[ Бrea de Descarregamento do petrуleo ]~~~~~~~~~~~~~~~~~•" );
if( IsTrailerAttachedToVehicle( GetPlayerVehicleID( playerid )) )
{
SendClientMessage( playerid, COLOR_CEU, " > Vocк entregou ( 100 por cento do petrуleo ) e recebe + $300 !" );
SetVehicleToRespawn( GetVehicleTrailer( GetPlayerVehicleID( playerid )) );
sGivePlayerCash( playerid, 1900 );
}
else
{
sGivePlayerCash( playerid, 2200 );
}
SendClientMessage( playerid, COLOR_AMARELO, "•~~~~~~~~~~~~~~~~~[ Бrea de Descarregamento do petrуleo ]~~~~~~~~~~~~~~~~~•" );
GameTextForPlayer( playerid, "~b~~w~~h~petrуleo~n~~y~~h~descarregado", 1000, 1 );
}
else if ( IsPlayerInPlace( playerid, 2128.1685, 918.0179, 10.8203, 176.8518 ))
{
CargaM[ playerid ] = 0;
SendClientMessage( playerid, COLOR_AMARELO, "•~~~~~~~~~~~~~~~~~[ Бrea de Descarregamento do petrуleo ]~~~~~~~~~~~~~~~~~•" );
SendClientMessage( playerid, COLOR_MINERADOR, "> Petrуleo descarregado com sucesso !" );
SendClientMessage( playerid, COLOR_MINERADOR, "> Vocк ganhou $1700 pelo petrуleo entregado com йxito !" );
SendClientMessage( playerid, COLOR_AMARELO, "•~~~~~~~~~~~~~~~~~[ Бrea de Descarregamento do petrуleo ]~~~~~~~~~~~~~~~~~•" );
if( IsTrailerAttachedToVehicle( GetPlayerVehicleID( playerid )) )
{
SendClientMessage( playerid, -1, "[ > ] Vocк entregou ( 100 por cento da carga ) e recebe + $200 !" );
SetVehicleToRespawn( GetVehicleTrailer( GetPlayerVehicleID( playerid )) );
sGivePlayerCash( playerid, 1500 );
}
else
{
sGivePlayerCash( playerid, 1700 );
}
SendClientMessage( playerid, COLOR_AMARELO, "•~~~~~~~~~~~~~~~~~[ Бrea de Descarregamento do petrуleo ]~~~~~~~~~~~~~~~~~•" );
GameTextForPlayer( playerid, "~b~~w~~h~petroleo~n~~y~~h~descarregado", 1000, 1 );
}
RemovePlayerMapIcon( playerid, 90 );
}
else if( CarregouP[ playerid ] == 1 )
{
foreach(Player, a)
{
if( aInfo[ a ][ Admin ] == 1 )
{
format( gStr, sizeof( gStr ), "[ NVL AC ] - O jogador %s [ id: %d ] entregou o minйrio muito rapido. Suspeita: Teleporte.", PlayerName( playerid ), playerid );
SendClientMessage( a, COLOR_ERRO, gStr );
SendClientMessage( a, COLOR_BRANCO, "- Vб checar este jogador ! ( OBS: Use '/Espiar' para ter certeza, isso pode ser um BUG, ou nгo ..." );
}
}
if( IsPlayerInPlace( playerid, 1002.5710, -940.6490, 42.1797, 92.4517 ))
{
CargaP[ playerid ] = 0;
SendClientMessage( playerid, COLOR_AMARELO, "•~~~~~~~~~~~~~~~~~[ Бrea de Descarregamento do petrуleo ]~~~~~~~~~~~~~~~~~•" );
SendClientMessage( playerid, COLOR_MINERADOR, "> Petrуleo descarregado com sucesso !" );
SendClientMessage( playerid, COLOR_MINERADOR, "> Vocк ganhou $1900 pelo minйrio entregado com йxito !" );
SendClientMessage( playerid, COLOR_AMARELO, "•~~~~~~~~~~~~~~~~~[ Бrea de Descarregamento do petrуleo ]~~~~~~~~~~~~~~~~~•" );
GameTextForPlayer( playerid, "~y~~h~descarregado", 1000, 0 );
RemovePlayerMapIcon( playerid, 90 );
}
else if ( IsPlayerInPlace( playerid, 2128.1685, 918.0179, 10.8203, 176.8518 ))
{
CargaP[ playerid ] = 0;
SendClientMessage( playerid, COLOR_AMARELO, "•~~~~~~~~~~~~~~~~~[ Бrea de Descarregamento do petrуleo ]~~~~~~~~~~~~~~~~~•" );
SendClientMessage( playerid, COLOR_MINERADOR, "> Petrуleo descarregado com sucesso !" );
SendClientMessage( playerid, COLOR_MINERADOR, "> Vocк ganhou $1700 pelo minйrio entregado com йxito !" );
SendClientMessage( playerid, COLOR_AMARELO, "•~~~~~~~~~~~~~~~~~[ Бrea de Descarregamento do petrуleo ]~~~~~~~~~~~~~~~~~•" );
GameTextForPlayer( playerid, "~y~~h~descarregado", 1000, 0 );
RemovePlayerMapIcon( playerid, 90 );
}
}
return 1;
}
Код:
if( !strcmp( cmd, "/carregarp", true ))
{
if( !IsPlayerInDynamicCP( playerid, CP_49 ))
{
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк nгo estб na area de carregamento de Petroleo! {FFFFFF}( Ela se localiza descendo a construзгo ) ( Siga a sinalizaзгo )" );
return 1;
}
if( CargaP[ playerid ] == 1 )
{
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Seu caminhгo jб estб carregado !" );
return 1;
}
if( CarregouP[ playerid ] == 1 )
{
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Aguarde 30 segundos para carregar o seu caminhгo novamente !" );
return 1;
}
if( GetVehicleModel( GetPlayerVehicleID( playerid )) != 514 )
{
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк nгo estб em um Roadtrain." );
return 1;
}
if( GetPlayerState( playerid ) != PLAYER_STATE_DRIVER )
{
SendClientMessage( playerid, COLOR_ERRO, "[ x ] Vocк deve estar dirigindo o caminhгo com uma carga para poder carregar !" );
return 1;
}
ShowPlayerDialog( playerid, D_CARGAP, DIALOG_STYLE_MSGBOX, "{FF0000}•»{00FF00}Бrea do Petroleo ®", "{FFFFFF}Escolha o local que deseja levar o petroleo:\n\n- {FAF65D}Los Santos {0000DD}( LS ) {FFFFFF}ou {FAF65D}San Fierro {0000DD}( SF )", "LS", "SF" );
return 1;
}
Creio que nгo й Necessario o Double post, fiz isso ontem e me arrependi : ), mais tente fazer em checkpoint e usar a funзгo
Obrigado... Mals pelo Double Post! Mas oque me preocupa mesmo й a questгo da entrega... De petroleo.