Check if trailer is in CP
#1

Does anybody has a snippit to see if trailers are inside CP's?

Like this:

3 trailers, player has to take one, there is only 1 correct trailer, if he takes the bad trailers and goes to CP, kaboom?
Reply
#2

You have to create them with ID's, then detect the trailer that is attached to the truck. Then see which trailer they have.
Reply
#3

Quote:
Originally Posted by ScottCFR
Посмотреть сообщение
You have to create them with ID's, then detect the trailer that is attached to the truck. Then see which trailer they have.
I have given id's but you can check if there is ANY trailer in the CP, but not if theres a CEARTAIN trailer in the CP

IsTrailerAttachedToVehicle(vehicleid)
Reply
#4

Yeah, like I said. Check to see what trailer is connected, after that if it = ID 1 and you want it to be ID 3 then blow their asses up.
Reply
#5

I can detect if there is a trailer connected, but not a specific one... if you know the answer, I cant see it, maybe post a little snippit?

Also I got this prob
pawn Код:
if (IsVehicleStreamedIn(NukeVeh))
pawn Код:
warning 202: number of arguments does not match definition
pawn Код:
new NukeVeh;
new Float:NukePos[][4] = {
    {306.0737,-185.9186,2.2207,269.9449},
    {-481.7236,-171.9510,78.8657,180.5097},
    {-1420.7559,-657.3433,14.7886,3.3196},
    {-2686.6155,1406.2490,7.7472,168.9163},
    {-333.7833,2673.6558,63.7544,0.0778},
    {385.6287,2438.8000,17.1408,359.9994},
    {1848.9811,2567.1213,11.4852,0.1451},
    {2299.3604,2812.1709,11.4848,180.9366},
    {2415.8772,2573.2937,22.4894,255.1552},
    {2813.8450,-1178.6844,25.8901,270.9640},
    {2724.5222,-2389.5203,14.2499,271.0007},
    {2195.6304,-2662.1436,14.2064,268.3514},
    {1303.6333,-1871.3523,14.1686,2.7109},
    {646.6082,-1767.0743,13.5037,347.8170},
    {-256.5617,-2214.2747,29.4268,114.5688},
    {-2188.6165,-2312.4912,31.2763,322.2286},
    {-2781.1118,769.5081,51.4829,269.5829}
};

new rand=random(sizeof(NukePos));

NukeVeh=AddStaticVehicle(591,NukePos[rand][0],NukePos[rand][1],NukePos[rand][2],NukePos[rand][3],1,1);
EDIT:
edited ignore message below
Reply
#6

Also I got this prob
pawn Код:
if (IsVehicleStreamedIn(NukeVeh))
pawn Код:
warning 202: number of arguments does not match definition
pawn Код:
new NukeVeh;
new Float:NukePos[][4] = {
    {306.0737,-185.9186,2.2207,269.9449},
    {-481.7236,-171.9510,78.8657,180.5097},
    {-1420.7559,-657.3433,14.7886,3.3196},
    {-2686.6155,1406.2490,7.7472,168.9163},
    {-333.7833,2673.6558,63.7544,0.0778},
    {385.6287,2438.8000,17.1408,359.9994},
    {1848.9811,2567.1213,11.4852,0.1451},
    {2299.3604,2812.1709,11.4848,180.9366},
    {2415.8772,2573.2937,22.4894,255.1552},
    {2813.8450,-1178.6844,25.8901,270.9640},
    {2724.5222,-2389.5203,14.2499,271.0007},
    {2195.6304,-2662.1436,14.2064,268.3514},
    {1303.6333,-1871.3523,14.1686,2.7109},
    {646.6082,-1767.0743,13.5037,347.8170},
    {-256.5617,-2214.2747,29.4268,114.5688},
    {-2188.6165,-2312.4912,31.2763,322.2286},
    {-2781.1118,769.5081,51.4829,269.5829}
};

new rand=random(sizeof(NukePos));

NukeVeh=AddStaticVehicle(591,NukePos[rand][0],NukePos[rand][1],NukePos[rand][2],NukePos[rand][3],1,1);
Thx in advance

EDIT: oops forgot I was last poster
Reply
#7

What line does that apply to?
Reply
#8

Quote:
Originally Posted by ScottCFR
Посмотреть сообщение
What line does that apply to?
if (IsVehicleStreamedIn(NukeVeh))


1183ublic UpdateMapIcon()
1184:{
1185: if (IsVehicleStreamedIn(NukeVeh))
1186: {
1187: new Float:X,Float:Y,Float:Z;
1188: GetVehiclePos(NukeVeh,X,Y,Z);
1189: DestroyDynamicMapIcon(MapIcon);
1190: MapIcon=CreateDynamicMapIcon(X,Y,Z,51,0xFFFFFFFF);
1191: }
1192:}

(1185) : warning 202: number of arguments does not match definition

EDIT: nvm about both, one is just a warning, it works fine, and u didnt tell me about GetVehicleTrailer :///////
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)