SA-MP Forums Archive
/rappel probby - 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: /rappel probby (/showthread.php?tid=61894)



/rappel probby - zallomallo - 16.01.2009

I am doing a rappel script. However whenever I type /rappel it will only lower ID 0, not hte person who hit /rappel.

pawn Код:
[   if(strcmp(cmd, "/rappel", true) == 0) {
    if(!IsPlayerInAnyVehicle(playerid) && IsIncargobob[playerid] == false) {
    SendClientMessage(playerid, Red1, "You must be in a cargobob to rappel!");
    return 1;
    }
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 548 && IsIncargobob[playerid] == false) {
    SendClientMessage(playerid, Red1, "This isn't a cargobob. You must be in one to rappel.");
    return 1;
    }
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 548) {
    SendClientMessage(playerid, Red1, "You can't rappel if you are the driver!");
    return 1;
    }
    if(IsIncargobob[playerid] == true) {
    SendClientMessage(playerid, Green1, "You are rappeling, hit space to stop.");
    Rappeling[playerid] = 1;
    new vehicleid = Playercargobob[playerid];
    TogglePlayerSpectating(playerid, false);
    new Float:X,Float:Y,Float:Z,Float:A;
    GetVehiclePos(vehicleid, X, Y, Z);
    GetVehicleZAngle(vehicleid, A);
    X += (2 * floatsin(-A, degrees));
    Y += (2 * floatcos(-A, degrees));
    SetPlayerPos(playerid, X, Y, Z);
    X += (2 * floatsin(-(A-45.0), degrees));
    Y += (2 * floatcos(-(A-45.0), degrees));
    SetPlayerPos(playerid, X, Y, Z);
    SetPlayerFacingAngle(playerid, A);
    SetCameraBehindPlayer(playerid);
    IsIncargobob[playerid] = false;
    Playercargobob[playerid] = 0;
    TogglePlayerControllable(playerid, 0);
    RapTimer[playerid] = SetTimer("RappelGoDown", 100, 1);
    return 1;
    }
    }

RappelGoDown:

pawn Код:
forward RappelGoDown(playerid);
public RappelGoDown(playerid)
{
    new Float:rx, Float:ry, Float:rz, Float:newrz;
    GetPlayerPos(playerid, rx, ry, rz);
    newrz = rz - 10;
    SetPlayerPos(playerid, rx, ry, newrz);
}



Re: /rappel probby - On_Top_Non_Stop - 16.01.2009

Try changing RapTimer[playerid] = SetTimer("RappelGoDown", 100, 1);

To

RapTimer[playerid] = SetTimerEx("RappelGoDown", 100, 1,"i",playerid);



Re: /rappel probby - zallomallo - 16.01.2009

Thank god, I knew somethign was wrong with the timer.



Re: /rappel probby - Stone1109 - 05.08.2009

Whatever happened to this script?