/trailer command
#1

hey,
Im new here and
I have my own SA-MP server (Hamachi)
but i want a command (/trailer),
But i searched everywere but i could not find what i want.
This is what i want :

(/trailer) = A command that shows op a menu with trailers for a truck and if u choose one then i needs to connect to the truck,

Hopefully can one of u help me,
Sorry for my bad english,

(P.S if there is a /trailer command please post a link an how to install cause im new here)
Reply
#2

up up
Reply
#3

Firstly Welcome!, Secondly you can use this but any way here :

if zcmd:
PHP код:
CMD:trailer(playeridparams[])
{
    
#pragma unused params
    
ShowPlayerDialog(playerid1234DIALOG_STYLE_LIST,"{CC3300}Trucks Available""Linerunner\n\rPetrol Tanker\n\rRoadtrain\n\rDFT-30""Select""Close");
    return 
1;

if strcmp (cmd):

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/trailer"cmdtexttrue) == 0)
    {
        
ShowPlayerDialog(playerid1234DIALOG_STYLE_LIST,"{CC3300}Trucks Available""Linerunner\n\rPetrol Tanker\n\rRoadtrain\n\rDFT-30""Select""Close");
        return 
1;
    }
    return 
0;

PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    if(
dialogid == 1234)
    {
        new
            
vid GetPlayerVehicleID(playerid),
            
videx,
            
randtrailer random(3),
            
Float:xFloat:yFloat:zFloat:a
        
;
        
GetPlayerPos(playeridxyz);
        
GetPlayerFacingAngle(playerida);
        if(
response)
        {
            switch(
listitem)
            {
                case 
0:
                {
                    
videx CreateVehicle(403xyza018000);
                    
PutPlayerInVehicle(playeridvidex0);
                    
LinkVehicleToInterior(vidGetPlayerInterior(playerid));
                    switch(
randtrailer)
                    {
                        case 
0:    AttachTrailerToVehicle(584vid);
                        case 
1AttachTrailerToVehicle(435vid);
                        case 
2AttachTrailerToVehicle(450vid);
                        case 
3AttachTrailerToVehicle(591vid);
                    }
                }
                case 
1:
                {
                    
videx CreateVehicle(514xyza018000);
                    
PutPlayerInVehicle(playeridvidex0);
                    
LinkVehicleToInterior(vidGetPlayerInterior(playerid));
                    switch(
randtrailer)
                    {
                        case 
0:    AttachTrailerToVehicle(584vid);
                        case 
1AttachTrailerToVehicle(435vid);
                        case 
2AttachTrailerToVehicle(450vid);
                        case 
3AttachTrailerToVehicle(591vid);
                    }
                }
                case 
2:
                {
                    
videx CreateVehicle(515xyza018000);
                    
PutPlayerInVehicle(playeridvidex0);
                    
LinkVehicleToInterior(vidGetPlayerInterior(playerid));
                    switch(
randtrailer)
                    {
                        case 
0:    AttachTrailerToVehicle(584vid);
                        case 
1AttachTrailerToVehicle(435vid);
                        case 
2AttachTrailerToVehicle(450vid);
                        case 
3AttachTrailerToVehicle(591vid);
                    }
                }
                case 
3:
                {
                    
videx CreateVehicle(578xyza018000);
                    
PutPlayerInVehicle(playeridvidex0);
                    
LinkVehicleToInterior(vidGetPlayerInterior(playerid));
                    switch(
randtrailer)
                    {
                        case 
0:    AttachTrailerToVehicle(584vid);
                        case 
1AttachTrailerToVehicle(435vid);
                        case 
2AttachTrailerToVehicle(450vid);
                        case 
3AttachTrailerToVehicle(591vid);
                    }
                }
            }
        }
        else { return 
1; }
    }
    return 
1;

EDIT: sorry I was a bit late
Reply
#4

How do i install that? im new
Reply
#5

I recommend you to read this topic
Reply
#6

Can you make a .pwn file for me of all this?
Reply
#7

up but coconut
Reply
#8

up up
Reply
#9

Dude he already gave you the code and told you what to do, but you want the easy way which will NOT help you at all, and we won't do all of the work for you.

I guess there are people that will do that for rep, I like to call them noobs.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)