decrease checkpoint size
#1

hi,


how can i decrease a checkpoint every 2 seconds?
lets say the cp has a radius of 100 at the beginning.
i tried but didnt work, cant i just decrease a float just like i would an integer?
Reply
#2

Decreasing the float size should work, but if not, show us your code.
Reply
#3

pawn Код:
new Float:CP_FLOAT[4];

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/x", cmdtext, true, 10) == 0)
    {
        new Float:x, Float:y, Float:z;
        GetPlayerPos(playerid,x,y,z);
        SetPlayerCheckpointEX(playerid,x,y,z,100);
        SetTimerEx("ZONEFLASH2",1000,false,"i",playerid);
        return 1;
    }
    return 0;
}

forward ZONEFLASH2(playerid);
public ZONEFLASH2(playerid)
{
    CP_FLOAT[3]--;
    SetTimerEx("ZONEFLASH2",1000,false,"i",playerid);
    SetPlayerCheckpoint(playerid,CP_FLOAT[0],CP_FLOAT[1],CP_FLOAT[2],CP_FLOAT[3]);
    return 1;
}

stock SetPlayerCheckpointEX(playerid,Float:x,Float:y,Float:z,Float:rad)
{
    CP_FLOAT[0]=x;
    CP_FLOAT[1]=y;
    CP_FLOAT[2]=z;
    CP_FLOAT[3]=rad;
    SetPlayerCheckpoint(playerid,x,y,z,rad);
    return 1;
}
Reply
#4

i tried to print the decreased radius in the ZONEFLASH2 timer and the value is decreasing.
But the checkpoint always stays the same.
Is there maybe a problem with setting a CP that shortly after another?
Normally it should get simply replaced by the new one as only one CP can be displayed at one time right?

i really dont knwo what mroe to do...
Reply
#5

try to destroy the checkpoint and make a new one at the same time with another radius
Reply
#6

pawn Код:
forward ZONEFLASH2(playerid);
public ZONEFLASH2(playerid)
{
    CP_FLOAT[3]--;
    DisablePlayerCheckpoint(playerid);
    SetTimerEx("ZONEFLASH2",1000,false,"i",playerid);
    SetPlayerCheckpoint(playerid,CP_FLOAT[0],CP_FLOAT[1],CP_FLOAT[2],CP_FLOAT[3]);
    return 1;
}
also tried, didnt work...
Reply
#7

It's a SA-MP bug, it doesn't work properly. The same thing happens with streamers.
Reply
#8

damn it...
I already suspected that...

Do you know what exactly the bug is?
Is there a getaround for this for example by Disabling the CP and make anohter time to set it with a smaller radius but slightly delayed from the CP Disable code?


thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)