public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_CROUCH)
{
new
Float:x,
Float:y,
Float:z;
GetVehiclePos(playerid, x, y, z);
SetVehiclePos(playerid, x, y, z + 10.0); //This thing ^doesnt do anything at all (suppose to be a superjump for cars)
}
if(newkeys == KEY_FIRE)
{
if(IsPlayerInAnyVehicle(playerid))
{
new Float:s[3];
GetVehicleVelocity(GetPlayerVehicleID(playerid),s[0],s[1],s[2]);
s[0]=1.5*s[0];
s[1]=1.5*s[1];
s[2]=1.5*s[2];
SetVehicleVelocity(GetPlayerVehicleID(playerid),s[0],s[1],s[2]); // This thing ^ only works if you are pressing alt with no other keys pressed.
}
return 1;
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys & KEY_CROUCH) //apparently, you're supposed to use "&", not "==" { new Float:x, Float:y, Float:z; GetVehiclePos(playerid, x, y, z); SetVehiclePos(playerid, x, y, z + 10.0); //This thing ^doesnt do anything at all (suppose to be a superjump for cars) } if(newkeys & KEY_FIRE) //same thing { if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) //you might also want to put this in, it makes it so that the passenger can't use the jump button. { new Float:s[3]; GetVehicleVelocity(GetPlayerVehicleID(playerid),s[0],s[1],s[2]); s[0]=1.5*s[0]; s[1]=1.5*s[1]; s[2]=1.5*s[2]; SetVehicleVelocity(GetPlayerVehicleID(playerid),s[0],s[1],s[2]); // This thing ^ only works if you are pressing alt with no other keys pressed. } return 1; } return 1; }
GetVehiclePos(playerid, x, y, z);
SetVehiclePos(playerid, x, y, z + 10.0); //This thing ^doesnt do anything at all (suppose to be a superjump for cars)
if(PRESSED(KEY_CROUCH))
{
if(PlayerIsInDM[playerid] == true)
{
SendClientMessage(playerid,COLOR_RED, "ERROR: You can't use this command in DM zone! Use /exitdm ");
}
if(IsPlayerInAnyVehicle(playerid) && PlayerIsInDM[playerid] == false)
{
new
Float:x,
Float:y,
Float:z;
GetVehiclePos(playerid, x, y, z);
SetVehiclePos(playerid, x, y, z + 10.0);
}
}
if(PRESSED(KEY_CROUCH))
{
if(PlayerIsInDM[playerid] == true)
{
SendClientMessage(playerid,COLOR_RED, "ERROR: You can't use this command in DM zone! Use /exitdm ");
}
if(IsPlayerInAnyVehicle(playerid) && PlayerIsInDM[playerid] == false)
{
new
pidofveh = GetPlayerVehicleID(playerid))
Float:x,
Float:y,
Float:z;
GetVehiclePos(pidofveh, x, y, z);
SetVehiclePos(pidofveh, x, y, z + 10.0);
}
}
C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(22520) : error 001: expected token: ";", but found ")" C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(22520) : error 029: invalid expression, assumed zero C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(22521) : warning 221: label name "Float" shadows tag name C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(22521) : error 017: undefined symbol "x" C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(22521 -- 22523) : warning 215: expression has no effect C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(22524) : error 017: undefined symbol "x" C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(22525) : error 017: undefined symbol "x" C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(22521) : warning 203: symbol is never used: "Float" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
if(PRESSED(KEY_CROUCH))
{
if(PlayerIsInDM[playerid] == true)
{
SendClientMessage(playerid,COLOR_RED, "ERROR: You can't use this command in DM zone! Use /exitdm ");
}
if(IsPlayerInAnyVehicle(playerid) && PlayerIsInDM[playerid] == false)
{
new
Float:x,
Float:y,
Float:z;
GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z + 10.0);
}
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_CROUCH) //apparently, you're supposed to use "&", not "=="
{
new
Float:x,
Float:y,
Float:z;
}
if(newkeys & KEY_FIRE) //same thing
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) //you might also want to put this in, it makes it so that the passenger can't use the jump button.
{
GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
new Float:s[3];
GetVehicleVelocity(GetPlayerVehicleID(playerid),s[0],s[1],s[2]);
s[0]=1.5*s[0];
s[1]=1.5*s[1];
s[2]=1.5*s[2];
SetVehicleVelocity(GetPlayerVehicleID(playerid),s[0],s[1],s[2]); // This thing ^ only works if you are pressing alt with no other keys pressed.
}
return 1;
}
return 1;
}
Originally Posted by whooper
Did you try what the one guy said.
pawn Код:
|