Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* SA-MP [FS] UnDrive-By
- *
- * Version: 1.01
- *
- * (c) Copyright 2013, AirKite
- *
- * URL: http://forum.sa-mp.com/showthread.php?p=2324746
- */
- #include <a_samp>
- #define DOUBLE_CLICK_TIME 1500 // ms (tick)
- #define REARMED_WEAPON_UPDATES 4 // count
- new
- g_TickPushed[MAX_PLAYERS],
- g_Count[MAX_PLAYERS char],
- g_Weapon[MAX_PLAYERS char];
- public OnFilterScriptInit() print("[FS] UnDrive-By Loaded!");
- public OnFilterScriptExit() print("[FS] UnDrive-By Unloaded!");
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
- if(newkeys & KEY_CROUCH && GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) {
- new tick = GetTickCount();
- if(tick - g_TickPushed[playerid] < DOUBLE_CLICK_TIME) {
- g_Weapon[playerid] = GetPlayerWeapon(playerid);
- g_Count[playerid] = REARMED_WEAPON_UPDATES;
- ApplyAnimation(playerid,"PED","facanger",4.1,0,1,1,1,1);
- SetPlayerArmedWeapon(playerid, 0);
- }
- g_TickPushed[playerid] = tick;
- }
- return 1;
- }
- public OnPlayerUpdate(playerid) {
- if(g_Count[playerid]) {
- if(--g_Count[playerid] == 0) {
- SetPlayerArmedWeapon(playerid, g_Weapon[playerid]);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement