SA-MP Forums Archive
[BUG] Checkoint - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [BUG] Checkoint (/showthread.php?tid=253966)



[BUG] Checkoint - deathrunner - 08.05.2011

hello in this command

pawn Код:
//on the top
#define spieler 75
#define heliid 497
#define seillaenge 80
#define skinid 285
#define abhoehe 11
#define dur 250

//This under OnPlayerCommandText
if(strcmp(strget(cmdtext,0), "/abseilen", true) == 0)
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        new Float:gesch;
        GetVehicleSpeed(vehicleid, gesch);
        if(gesch <= 20)
            {
                if(GetPlayerSkin(playerid) == skinid && GetPVarInt(playerid,"abseilend") == 0 && GetPlayerVehicleSeat(playerid) != 0 && IsPlayerInAnyVehicle(playerid))
                    {
                        GetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][2]);
                        MapAndreas_FindZ_For2DCoord(pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][3]);
                        pl_pos[playerid][4] = floatsub(pl_pos[playerid][2],pl_pos[playerid][3]);
                        if(pl_pos[playerid][4] >= seillaenge)
                            {
                                return SendClientMessage(playerid,COLOR_RED,"Das Seil ist zu kurz um sich abseilen zu kцnnen");
                            }
                        if(pl_pos[playerid][4] <= 2)
                            {
                                return RemovePlayerFromVehicle(playerid);
                            }
                        SetPVarInt(playerid,"abseilend",1);
                        SetPlayerCheckpoint(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][3],abhoehe),15);
                        SetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][2],2));
                        SetPlayerVelocity(playerid,0,0,0);
                        SetPlayerHealth(playerid, 1000);
                        for(new rep=0;rep!=10;rep++) ApplyAnimation(playerid,"ped","abseil",4.0,0,0,0,1,0);
                        for(new cre=0;cre<=pl_pos[playerid][4];cre++)
                            {
                                r0pes[playerid][cre] = CreateObject(3004,pl_pos[playerid][0],pl_pos[playerid][1],floatadd(pl_pos[playerid][3],cre),87.640026855469,342.13500976563, 350.07507324219);
                            }
                        SetTimerEx("syncanim",dur,0,"i",playerid);
                    }
            }
        return 1;
    }

//This under OnPlayerEnterCheckpoint
if(GetPVarInt(playerid,"abseilend") == 1 && GetPlayerSkin(playerid) == skinid && IsPlayerInRangeOfPoint(playerid, 15, pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][3]))
        {
            SetPVarInt(playerid,"abseilend",0);
            SetPVarInt(playerid,"chop_id",0);
            ClearAnimations(playerid);
            TogglePlayerControllable(playerid,0);
            TogglePlayerControllable(playerid,1);
            DisablePlayerCheckpoint(playerid);
            SetPlayerHealth(playerid, 100);
            for(new destr4=0;destr4<=seillaenge;destr4++)
                {
                    DestroyObject(r0pes[playerid][destr4]);
                }
        }
the server doesnt create the checkpoint, please help me

whats the mistake


Re: [BUG] Checkoint - coole210 - 08.05.2011

Try..

Код:
SetPlayerCheckpoint(playerid,pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][2],15);
Код:
SetPlayerCheckpoint(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][2],abhoehe),15);



AW: [BUG] Checkoint - deathrunner - 08.05.2011

ok now it works but when i do this, then no rope comes


AW: [BUG] Checkoint - deathrunner - 09.05.2011

and when i do your code, and i write ingame the command, so im removed only from vehicle und teh checkpoint ist not here


AW: [BUG] Checkoint - deathrunner - 09.05.2011

Ok i found the mistake

but one mistake is now

pawn Код:
new vehicleid = GetPlayerVehicleID(playerid);
    new Float:gesch;
    GetVehicleSpeed(vehicleid, gesch);
    if(gesch <= 20)
            {
                if(GetPlayerSkin(playerid) == skinid && GetPVarInt(playerid,"abseilend") == 0 && GetPlayerVehicleSeat(playerid) != 0 && IsPlayerInAnyVehicle(playerid) && (newkeys & KEY_LOOK_LEFT || newkeys == KEY_LOOK_LEFT))
                    {
                        GetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][2]);
                        MapAndreas_FindZ_For2DCoord(pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][3]);
                        pl_pos[playerid][4] = floatsub(pl_pos[playerid][2],pl_pos[playerid][3]);
                        if(pl_pos[playerid][4] >= seillaenge)
                            {
                                return SendClientMessage(playerid,COLOR_RED,"Das Seil ist zu kurz um sich abseilen zu kцnnen");
                            }
                        if(pl_pos[playerid][4] <= 10)
                            {
                                return RemovePlayerFromVehicle(playerid);
                            }
                        SetPVarInt(playerid,"abseilend",1);
                        SetPlayerCheckpoint(playerid,pl_pos[playerid][0],pl_pos[playerid][1],pl_pos[playerid][3], 15);
                        SetPlayerPos(playerid,pl_pos[playerid][0],pl_pos[playerid][1],floatsub(pl_pos[playerid][2],2));
                        SetPlayerVelocity(playerid,0,0,0);
                        SetPlayerHealth(playerid, 1000);
                        IsBeimAbseilen[playerid]=1;
                        for(new rep=0;rep!=10;rep++) ApplyAnimation(playerid,"ped","abseil",4.0,0,0,0,1,0);
                        for(new cre=0;cre<=pl_pos[playerid][4];cre++)
                            {
                                r0pes[playerid][cre] = CreateObject(3004,pl_pos[playerid][0],pl_pos[playerid][1],floatadd(pl_pos[playerid][3],cre),87.640026855469,342.13500976563, 350.07507324219);
                            }
                        SetTimerEx("syncanim",dur,0,"i",playerid);
                    }
            }
how i made this that he can use the rope when he is not in the air, when he is on ground , the script shuld remove him