SA-MP Forums Archive
Why wont this work? - 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)
+--- Thread: Why wont this work? (/showthread.php?tid=345548)



Why wont this work? - Dan. - 25.05.2012

So when presses "C" key, the crouch key, it should spawn a ramp in front of him. Can anyone tell me what's the problem?

pawn Код:
else if(PRESSED(KEY_CROUCH))
    {
        if(PlayerInfo[playerid][pRampAktiivne] == 1)
        {
            DestroyObject(PlayerInfo[playerid][pRamp]);
            new Float: pX, Float: pY, Float: pZ, Float: vA, autoid;
           
            autoid = GetPlayerVehicleID(playerid);
            GetPlayerPos(playerid, pX, pY, pZ);
            GetVehicleZAngle(autoid, vA);

            PlayerInfo[playerid][pRamp] = CreateObject(PlayerInfo[playerid][pRampStiil], pX + (20.0 * floatsin(-vA, degrees)), pY + (20.0 * floatcos(-vA, degrees)), pZ, 0, 0, vA);
            SetTimerEx("KustutaRamp", 1000*4, 0, "i", playerid);
        }
    }
And this is CMD for changing styles (PlayerInfo[playerid][pRampStiil]):

pawn Код:
CMD:stiil1(playerid, params[])
{
    if(PlayerInfo[playerid][pRampAktiivne] == 0) return SendClientMessage(playerid, C_RED, "SERVER: Pead enne rambid sisse lьlitama (/ramp)!");
    SendClientMessage(playerid, C_INDIGO, "SERVER: Sinu rambi stiil on nььd 1!");
    PlayerInfo[playerid][pRampStiil] = 1655;
    return 1;
}



Re: Why wont this work? - ViniBorn - 25.05.2012

"KEY_CROUCH" "C" works only on foot


Re: Why wont this work? - SuperViper - 25.05.2012

In a vehicle, KEY_CROUCH is for your horn key.