Why wont this work?
#1

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;
}
Reply
#2

"KEY_CROUCH" "C" works only on foot
Reply
#3

In a vehicle, KEY_CROUCH is for your horn key.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)