23.09.2012, 13:18
Hello. I am making a barricade system, however when I am going to destroy the barricades, it only destroys the last one.
I know what is wrong, it's because it's only storing the last cade, but I don't know how to fix it. This is my code:
I know what is wrong, it's because it's only storing the last cade, but I don't know how to fix it. This is my code:
pawn Код:
CMD:cade(playerid, params[])
{
for(new i;i<MAX_BARRICADES;i++)
{
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
cade[i] = CreateObject(981, x, y, z, 0.0, 0.0, a);
SetPlayerPos(playerid, x, y-1, z);
}
return 1;
}
CMD:destroycades(playerid, params[])
{
for(new i;i<MAX_BARRICADES;i++)
{
DestroyObject(cade[i]);
}
return 1;
}