how hide trailer
#1

hi guys

I have a big problem in my fs

when player by truck going to checkpoint his Trailer Detach from vehicle but no hidden

how i can hidden Trailer.

please help me.
[sorry for my sick English language]
Reply
#2

Show us Checkpoint codes.
Reply
#3

Quote:
Originally Posted by [vTc]Patroool
Посмотреть сообщение
Show us Checkpoint codes.
PHP код:
//include
#include <a_samp>
//define
#define COLOR_DARKGOLD 0x808000AA
#define COLOR_RED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
//CP_job
#define Checkpoint1 -1647.900,28.1000,3.2000
#define Checkpoint2 -231.8289,-1467.9810,4.9421
//new
new jobrunning 0;
new 
more;
//forward
forward GivePlayerOneExp(playerid);
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" kar kamiyon");
    print(
"--------------------------------------\n");
    
    
//more (CreatePickup)
    
more CreatePickup(1254,2,-1634.90067.699,  3.200,-1);
    return 
1;
}
public 
OnFilterScriptExit()
{
    return 
1;
}
#else
main()
{
    print(
"\n----------------------------------");
    print(
" kar kamiyon");
    print(
"----------------------------------\n");
}
#endif
public OnGameModeInit()
{
//trucks
CreateVehicle(515, -1587.7993111.57464.8161226.8379, -1, -1100);
CreateVehicle(515, -1592.3186107.22654.8901228.0000, -1, -1100);
CreateVehicle(515, -1596.6328103.07994.7612227.8919, -1, -1100);
//trilers
CreateVehicle(584, -1582.616979.41105.47530.0000, -1, -1100);
CreateVehicle(435, -1589.729980.27745.47530.0000, -1, -1100);
return 
1;
}
public 
OnGameModeExit()
{
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    return 
1;
}
public 
OnVehicleSpawn(vehicleid)
{
    return 
1;
}
public 
OnVehicleDeath(vehicleidkillerid)
{
    return 
1;
}
public 
OnPlayerText(playeridtext[])
{
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/bar"cmdtexttrue10) == 0)
    {
    
    if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 515)
    {
    if(
GetVehicleTrailer(GetPlayerVehicleID(playerid))) SendClientMessage(playeridCOLOR_YELLOW"Shoma Trailer Darid");
    else 
SendClientMessage(playeridCOLOR_RED"Shoma Trailer Nadarid");
    
SetPlayerCheckpoint(playeridCheckpoint13.0);
    
jobrunning 1;
    
GameTextForPlayer(playerid"~g~Shoma Kar Ra shoro Kardid Movafagh Bashid kargar zahmatkesh..."30003);
    new 
name[MAX_PLAYER_NAME], string[48];
    
GetPlayerName(playeridnamesizeof(name));
    
format(stringsizeof(string), "ranandeye por kar %s dar hale haml bar ast ."name );
    
SendClientMessageToAll(COLOR_REDstring);
    return 
1;
    }
    
SendClientMessage(playeridCOLOR_RED,"Shoma mitavanid Mashine Haml Bar  Ra Ke Nar Khalij peyda konid (age peyda nakardid az adminha beporsid)...");
    }
    if (
strcmp("/kamiyonhelp"cmdtexttrue10) == 0)
    {
    
SendClientMessage(playeridCOLOR_YELLOW"Shoma bayad bar ra noghteye moredenazar bebarid.");
    
SendClientMessage(playeridCOLOR_YELLOW"az mashin piyade nashid.");
    
SendClientMessage(playeridCOLOR_YELLOW"Poli ke az in kar be dast miavarid = 55000$.");
    return 
1;
    }
    return 
0;
}
public 
OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
 if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 515)
     {
         
SendClientMessage(playeridCOLOR_RED"Bar ra bardarid va be noghteye ghermez beravid");
     }
 return 
0;
}
public 
OnPlayerExitVehicle(playeridvehicleid)
{
    if((
jobrunning) == 1)
    {
        
jobrunning 0;
        
SendClientMessage(playeridCOLOR_RED"shoma nabayad piyyade mishodid az mashine keshavarzi va bayad dobare savar shid va bezanid /bar.");
    }else if((
jobrunning) == 0){
        
//Nothing
 
}
}
public 
OnPlayerStateChange(playeridnewstateoldstate)
{
    return 
1;
}
public 
OnPlayerEnterCheckpoint(playerid)
{
if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 515)
   {
     if (
IsPlayerInRangeOfPoint(playerid7.0,Checkpoint1))
     {
          
SetPlayerCheckpoint(playeridCheckpoint27.0);
     }
     if (
IsPlayerInRangeOfPoint(playerid7.0,Checkpoint2))
     {
          
GivePlayerMoney(playerid50000);
           
GameTextForPlayer(playerid"~g~Tabrik Shoma kar Ra tamam kardid va $55000 Gereftid"30003);
          
SetVehicleToRespawn(2);
          
jobrunning 0;
          
DisablePlayerCheckpoint(playerid);
          
DetachTrailerFromVehicle(435 && 584);
          
DestroyVehicle(435 && 584);
          
     }
   }
}
public 
OnPlayerLeaveCheckpoint(playerid)
{
    return 
1;
}
public 
OnPlayerEnterRaceCheckpoint(playerid)
{
    return 
1;
}
public 
OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 
1;
}
public 
OnRconCommand(cmd[])
{
    return 
1;
}
public 
OnPlayerRequestSpawn(playerid)
{
    return 
1;
}
public 
OnObjectMoved(objectid)
{
    return 
1;
}
public 
OnPlayerObjectMoved(playeridobjectid)
{
    return 
1;
}
public 
OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == more)
    {
    
GameTextForPlayer(playerid"~g~baraye etelaate bishtar darbareye kar bezanid /kamiyonhelp"30003);
    }
}
public 
OnVehicleMod(playeridvehicleidcomponentid)
{
    return 
1;
}
public 
OnVehiclePaintjob(playeridvehicleidpaintjobid)
{
    return 
1;
}
public 
OnVehicleRespray(playeridvehicleidcolor1color2)
{
    return 
1;
}
public 
OnPlayerSelectedMenuRow(playeridrow)
{
    return 
1;
}
public 
OnPlayerExitedMenu(playerid)
{
    return 
1;
}
public 
OnPlayerInteriorChange(playeridnewinterioridoldinteriorid)
{
    return 
1;
}
public 
OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    return 
1;
}
public 
OnRconLoginAttempt(ip[], password[], success)
{
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    return 
1;
}
public 
OnPlayerStreamIn(playeridforplayerid)
{
    return 
1;
}
public 
OnPlayerStreamOut(playeridforplayerid)
{
    return 
1;
}
public 
OnVehicleStreamIn(vehicleidforplayerid)
{
    return 
1;
}
public 
OnVehicleStreamOut(vehicleidforplayerid)
{
    return 
1;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    return 
1;
}
public 
OnPlayerClickPlayer(playeridclickedplayeridsource)
{
    return 
1;

Reply
#4

Replace DestroyVehicle(435 && 584); with:
pawn Код:
DestroyVehicle(GetVehicleTrailer(GetPlayerVehicleID(playerid)));
and remove DetachTrailerFromVehicle(435 && 584);
Reply
#5

-Removed-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)