2021-01-28, 08:33 PM
(This post was last modified: 2021-01-28, 08:37 PM by Nikolay_Staggs.)
Tengo una duda c?mo puedo enganchar un remolque y que se marqu? un CreateDynamicCP tengo esta?funci?n
public OnPlayerAttachTrailer(playerid, vehicleid, trailerid)
{
if(IsTrailerAttachedToVehicle(vehicleid) && SPAWN_REMOLQUE_GASOLINA != 1)
{
Random_Gasolina(playerid);
}
? ? return 1;
}
stock Random_Gasolina(playerid)
{
new Gascolina = random(3);
switch(Gascolina)
{
case 0:
{
if(IsValidDynamicCP(PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT]))
{
DestroyDynamicCP(PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT]);
PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT] = INVALID_STREAMER_ID;
}
PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT] = CreateDynamicCP(363.3305, 869.4847, 20.3811, 5.0, 0, 0, playerid, 9999999999.0);
SendClientMessage(playerid, -1, "Lleva el remolque hacia donde se marc?");
new info[1];
info[0] = CHECKPOINT_TYPE_ENTER_GASOLINE;
Streamer_SetArrayData(STREAMER_TYPE_CP, PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT], E_STREAMER_EXTRA_ID, info);
}
case 1:
{
if(IsValidDynamicCP(PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT]))
{
DestroyDynamicCP(PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT]);
PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT] = INVALID_STREAMER_ID;
}
PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT] = CreateDynamicCP(-137.1521, -72.7862, 3.0911, 5.0, 0, 0, playerid, 9999999999.0);
SendClientMessage(playerid, -1, "Lleva el remolque hacia donde se marc?");
new info[1];
info[0] = CHECKPOINT_TYPE_ENTER_GASOLINE;
Streamer_SetArrayData(STREAMER_TYPE_CP, PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT], E_STREAMER_EXTRA_ID, info);
}
case 2:
{
if(IsValidDynamicCP(PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT]))
{
DestroyDynamicCP(PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT]);
PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT] = INVALID_STREAMER_ID;
}
PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT] = CreateDynamicCP(2822.7476, 955.9294, 10.7289, 5.0, 0, 0, playerid, 9999999999.0);
SendClientMessage(playerid, -1, "Lleva el remolque hacia donde se marc?");
new info[1];
info[0] = CHECKPOINT_TYPE_ENTER_GASOLINE;
Streamer_SetArrayData(STREAMER_TYPE_CP, PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT], E_STREAMER_EXTRA_ID, info);
}
}
return 1;
}
public OnPlayerAttachTrailer(playerid, vehicleid, trailerid)
{
if(IsTrailerAttachedToVehicle(vehicleid) && SPAWN_REMOLQUE_GASOLINA != 1)
{
Random_Gasolina(playerid);
}
? ? return 1;
}
stock Random_Gasolina(playerid)
{
new Gascolina = random(3);
switch(Gascolina)
{
case 0:
{
if(IsValidDynamicCP(PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT]))
{
DestroyDynamicCP(PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT]);
PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT] = INVALID_STREAMER_ID;
}
PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT] = CreateDynamicCP(363.3305, 869.4847, 20.3811, 5.0, 0, 0, playerid, 9999999999.0);
SendClientMessage(playerid, -1, "Lleva el remolque hacia donde se marc?");
new info[1];
info[0] = CHECKPOINT_TYPE_ENTER_GASOLINE;
Streamer_SetArrayData(STREAMER_TYPE_CP, PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT], E_STREAMER_EXTRA_ID, info);
}
case 1:
{
if(IsValidDynamicCP(PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT]))
{
DestroyDynamicCP(PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT]);
PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT] = INVALID_STREAMER_ID;
}
PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT] = CreateDynamicCP(-137.1521, -72.7862, 3.0911, 5.0, 0, 0, playerid, 9999999999.0);
SendClientMessage(playerid, -1, "Lleva el remolque hacia donde se marc?");
new info[1];
info[0] = CHECKPOINT_TYPE_ENTER_GASOLINE;
Streamer_SetArrayData(STREAMER_TYPE_CP, PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT], E_STREAMER_EXTRA_ID, info);
}
case 2:
{
if(IsValidDynamicCP(PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT]))
{
DestroyDynamicCP(PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT]);
PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT] = INVALID_STREAMER_ID;
}
PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT] = CreateDynamicCP(2822.7476, 955.9294, 10.7289, 5.0, 0, 0, playerid, 9999999999.0);
SendClientMessage(playerid, -1, "Lleva el remolque hacia donde se marc?");
new info[1];
info[0] = CHECKPOINT_TYPE_ENTER_GASOLINE;
Streamer_SetArrayData(STREAMER_TYPE_CP, PLAYER_TEMP[playerid][pt_TRAILERO_CHECKPOINT], E_STREAMER_EXTRA_ID, info);
}
}
return 1;
}