28.03.2013, 18:11
Graffiti System for "key_fire" and "key_aim" where editing? how should
if(HOLDING(KEY_AIM) && PRESSED(KEY_FIRE))
KEY_AIM isn't defined by default. Add this at the top of your script: #define KEY_AIM KEY_HANDBRAKE Also, HOLDING() and PRESSED() are macros that can be found here: https://sampwiki.blast.hk/wiki/GetPlayerKeys Help to happy, am I. |
#define HOLDING(%0) \
((newkeys & (%0)) == (%0))
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
if((newkeys & KEY_FIRE) && (oldkeys & KEY_FIRE) || (newkeys & KEY_FIRE) && (oldkeys & KEY_HANDBRAKE))
{
if(GetPlayerWeapon(playerid) == 41 && GraffitiBoyuyor[playerid] == 1)
{
SetTimerEx("SprayBoyuyorKontrol", 500, false, "d", playerid);
}
}
forward SprayBoyuyorKontrol(playerid);
public SprayBoyuyorKontrol(playerid)
{
new keys, ud, lr;
GetPlayerKeys(playerid, keys, ud, lr);
if (!(keys & CCKey))
{
return false;
}
if(PlayerToPoint(5.0,playerid,Graffitiler[DuzenledigiGraffiti[playerid]][ObjeX],Graffitiler[DuzenledigiGraffiti[playerid]][ObjeY],Graffitiler[DuzenledigiGraffiti[playerid]][ObjeZ]))
{
if(GetPlayerWeapon(playerid) == 41 && GraffitiBoyuyor[playerid] == 1)
{
Graffitiler[DuzenledigiGraffiti[playerid]][Kalan] -= 1;
}
}
return SetTimerEx("SprayBoyuyorKontrol",500, false, "d", playerid);
}