30.10.2013, 19:19
Hello everyone,today i will be showing you how to make a /tcar command so that rcon admins can spawn a tuned car with nos,rims ect.If you want you can link it to your admin system so all admins can use it,so lets get started.
Make sure you include zcmd at the top of your script,and define the color at the top too.
First lets make the cmd,the cmd will be /tcar if you want you can change the name of the cmd.
Now we are going to make it so that only rcon admins can use it.This code will make it for rcon admins only.
If you want anyone to use this cmd do not add this code.
Now we are going to make the car and add the nos ect.
This code spawns the car id so if you want to spawn an infernus you will put infernus car id where it has 411.
411 is the car id,change that id if you want to add a different veh id.
We also want to send a message to the admin when he spawns the car so we will add this to the bottom on the code.
This is how the code will look when its done.
Well this is the end of this tut,i hope this helped and if you have any problems please comment below.
Thanks-[YrR]Jeremy.
Make sure you include zcmd at the top of your script,and define the color at the top too.
pawn Код:
#include <zcmd>
#define COLOR_LIGHTBLUE 0x33CCFFFF
pawn Код:
CMD:tcar(playerid, params[])
{
If you want anyone to use this cmd do not add this code.
pawn Код:
if(!IsPlayerAdmin(playerid)) return 0;
pawn Код:
new Float:X,Float:Y,Float:Z,Float:Angle,LVehicleIDt;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
LVehicleIDt = CreateVehicle(411,X,Y,Z,Angle,1,-1,-1); //change the 411 to another car id if you want a different car
PutPlayerInVehicle(playerid,LVehicleIDt,0);
AddVehicleComponent(LVehicleIDt, 1028); AddVehicleComponent(LVehicleIDt, 1030); AddVehicleComponent(LVehicleIDt, 1031); AddVehicleComponent(LVehicleIDt, 1138); AddVehicleComponent(LVehicleIDt, 1140); AddVehicleComponent(LVehicleIDt, 1170);
AddVehicleComponent(LVehicleIDt, 1028); AddVehicleComponent(LVehicleIDt, 1030); AddVehicleComponent(LVehicleIDt, 1031); AddVehicleComponent(LVehicleIDt, 1138); AddVehicleComponent(LVehicleIDt, 1140); AddVehicleComponent(LVehicleIDt, 1170);
AddVehicleComponent(LVehicleIDt, 1080); AddVehicleComponent(LVehicleIDt, 1086); AddVehicleComponent(LVehicleIDt, 1087); AddVehicleComponent(LVehicleIDt, 1010);
ChangeVehiclePaintjob(LVehicleIDt,1);
SetVehicleVirtualWorld(LVehicleIDt, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(LVehicleIDt, GetPlayerInterior(playerid));
return 1;
}
411 is the car id,change that id if you want to add a different veh id.
pawn Код:
LVehicleIDt = CreateVehicle(411,X,Y,Z,Angle,1,-1,-1);
pawn Код:
SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have spawned an Infernus (id 411).")
pawn Код:
CMD:tcar(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return 0;
new Float:X,Float:Y,Float:Z,Float:Angle,LVehicleIDt;
GetPlayerPos(playerid,X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
LVehicleIDt = CreateVehicle(411,X,Y,Z,Angle,1,-1,-1);
PutPlayerInVehicle(playerid,LVehicleIDt,0);
AddVehicleComponent(LVehicleIDt, 1028); AddVehicleComponent(LVehicleIDt, 1030); AddVehicleComponent(LVehicleIDt, 1031); AddVehicleComponent(LVehicleIDt, 1138); AddVehicleComponent(LVehicleIDt, 1140); AddVehicleComponent(LVehicleIDt, 1170);
AddVehicleComponent(LVehicleIDt, 1028); AddVehicleComponent(LVehicleIDt, 1030); AddVehicleComponent(LVehicleIDt, 1031); AddVehicleComponent(LVehicleIDt, 1138); AddVehicleComponent(LVehicleIDt, 1140); AddVehicleComponent(LVehicleIDt, 1170);
AddVehicleComponent(LVehicleIDt, 1080); AddVehicleComponent(LVehicleIDt, 1086); AddVehicleComponent(LVehicleIDt, 1087); AddVehicleComponent(LVehicleIDt, 1010);
ChangeVehiclePaintjob(LVehicleIDt,1);
SetVehicleVirtualWorld(LVehicleIDt, GetPlayerVirtualWorld(playerid));
LinkVehicleToInterior(LVehicleIDt, GetPlayerInterior(playerid));
SendClientMessage(playerid,COLOR_LIGHTBLUE,"You have spawned an Infernus (id 411).")
return 1;
}
Thanks-[YrR]Jeremy.