/trailer command -
Macerz - 23.10.2012
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)
Re: /trailer command -
Macerz - 23.10.2012
up up
Re: /trailer command -
Youice - 23.10.2012
Firstly
Welcome!, Secondly you can use
this but any way here :
if zcmd:
PHP код:
CMD:trailer(playerid, params[])
{
#pragma unused params
ShowPlayerDialog(playerid, 1234, DIALOG_STYLE_LIST,"{CC3300}Trucks Available", "Linerunner\n\rPetrol Tanker\n\rRoadtrain\n\rDFT-30", "Select", "Close");
return 1;
}
if strcmp (cmd):
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/trailer", cmdtext, true) == 0)
{
ShowPlayerDialog(playerid, 1234, DIALOG_STYLE_LIST,"{CC3300}Trucks Available", "Linerunner\n\rPetrol Tanker\n\rRoadtrain\n\rDFT-30", "Select", "Close");
return 1;
}
return 0;
}
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1234)
{
new
vid = GetPlayerVehicleID(playerid),
videx,
randtrailer = random(3),
Float:x, Float:y, Float:z, Float:a
;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
if(response)
{
switch(listitem)
{
case 0:
{
videx = CreateVehicle(403, x, y, z, a, 0, 1, 8000);
PutPlayerInVehicle(playerid, videx, 0);
LinkVehicleToInterior(vid, GetPlayerInterior(playerid));
switch(randtrailer)
{
case 0: AttachTrailerToVehicle(584, vid);
case 1: AttachTrailerToVehicle(435, vid);
case 2: AttachTrailerToVehicle(450, vid);
case 3: AttachTrailerToVehicle(591, vid);
}
}
case 1:
{
videx = CreateVehicle(514, x, y, z, a, 0, 1, 8000);
PutPlayerInVehicle(playerid, videx, 0);
LinkVehicleToInterior(vid, GetPlayerInterior(playerid));
switch(randtrailer)
{
case 0: AttachTrailerToVehicle(584, vid);
case 1: AttachTrailerToVehicle(435, vid);
case 2: AttachTrailerToVehicle(450, vid);
case 3: AttachTrailerToVehicle(591, vid);
}
}
case 2:
{
videx = CreateVehicle(515, x, y, z, a, 0, 1, 8000);
PutPlayerInVehicle(playerid, videx, 0);
LinkVehicleToInterior(vid, GetPlayerInterior(playerid));
switch(randtrailer)
{
case 0: AttachTrailerToVehicle(584, vid);
case 1: AttachTrailerToVehicle(435, vid);
case 2: AttachTrailerToVehicle(450, vid);
case 3: AttachTrailerToVehicle(591, vid);
}
}
case 3:
{
videx = CreateVehicle(578, x, y, z, a, 0, 1, 8000);
PutPlayerInVehicle(playerid, videx, 0);
LinkVehicleToInterior(vid, GetPlayerInterior(playerid));
switch(randtrailer)
{
case 0: AttachTrailerToVehicle(584, vid);
case 1: AttachTrailerToVehicle(435, vid);
case 2: AttachTrailerToVehicle(450, vid);
case 3: AttachTrailerToVehicle(591, vid);
}
}
}
}
else { return 1; }
}
return 1;
}
EDIT: sorry I was a bit late
Re: /trailer command -
Macerz - 23.10.2012
How do i install that? im new
Re: /trailer command -
Youice - 23.10.2012
I recommend you to read
this topic
Re: /trailer command -
Macerz - 23.10.2012
Can you make a .pwn file for me of all this?
Re: /trailer command -
Macerz - 23.10.2012
up but coconut
Re: /trailer command -
Macerz - 24.10.2012
up up
Re: /trailer command -
gtakillerIV - 24.10.2012
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.