25.05.2012, 14:36
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?
And this is CMD for changing styles (PlayerInfo[playerid][pRampStiil]):
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);
}
}
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;
}