Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <zcmd>
- #define COLOR_RED 0xAA3333AA
- #define COLOR_GREEN 0x33AA33AA
- #define SCOPE_PRICE 1000
- #define SILENCER_PRICE 1000
- new
- p_Silencer[MAX_PLAYERS],
- p_Scope[MAX_PLAYERS],
- p_ScopeAttached[MAX_PLAYERS],
- p_SilencerAttached[MAX_PLAYERS];
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by your name here");
- print("----------------------------------\n");
- }
- #endif
- public OnPlayerSpawn(playerid)
- {
- PreloadAnimLib(playerid,"BUDDY" );
- ApplyAnimation(playerid,"BUDDY","buddy_reload",4.1,1,1,1,1,1000,1);
- return true;
- }
- PreloadAnimLib(playerid, animlib[])
- {
- ApplyAnimation(playerid,animlib,"null",0.0,0,0,0,0,0);
- }
- CMD:buyscope(playerid,params[])
- {
- #pragma unused params
- new string[64];
- if(GetPlayerMoney(playerid) < SCOPE_PRICE)
- return SendClientMessage(playerid,COLOR_RED,"You dont have enough money");
- if(p_Scope[playerid] >= 1)
- return SendClientMessage(playerid,COLOR_RED,"You already have this upgrade!");
- p_Scope[playerid] = 1;
- GivePlayerMoney(playerid,-SCOPE_PRICE);
- format(string,sizeof(string),"Notification: Scope purchased for %i$",SCOPE_PRICE);
- SendClientMessage(playerid,COLOR_GREEN,string);
- return true;
- }
- CMD:attachscope(playerid,params[])
- {
- #pragma unused params
- new ammo;
- if(p_Scope[playerid] == 0)
- return SendClientMessage(playerid,COLOR_RED,"You dont own a scope!");
- if(GetPlayerWeapon(playerid) != 33)
- return SendClientMessage(playerid,COLOR_RED,"You need to hold a rifle in order to do this!");
- ammo = GetPlayerAmmo(playerid);
- GivePlayerWeapon(playerid,34,1);
- SetPlayerAmmo(playerid,WEAPON_SNIPER,ammo);
- ApplyAnimation(playerid,"BUDDY","buddy_reload",4.1,0,1,1,1,1000,0);
- p_ScopeAttached[playerid] = 1;
- return true;
- }
- CMD:detachscope(playerid,params[])
- {
- #pragma unused params
- new ammo;
- if(p_ScopeAttached[playerid] == 0)
- return SendClientMessage(playerid,COLOR_RED,"You dont have a scope attached!");
- if(GetPlayerWeapon(playerid) != 34)
- return SendClientMessage(playerid,COLOR_RED,"You are not holding a sniper rifle!");
- ammo = GetPlayerAmmo(playerid);
- GivePlayerWeapon(playerid,33,1);
- SetPlayerAmmo(playerid,WEAPON_RIFLE,ammo);
- ApplyAnimation(playerid,"BUDDY","buddy_reload",4.1,0,1,1,1,1000,1);
- p_ScopeAttached[playerid] = 0;
- return true;
- }
- CMD:detachsilencer(playerid,params[])
- {
- #pragma unused params
- new ammo;
- if(p_SilencerAttached[playerid] == 0)
- return SendClientMessage(playerid,COLOR_RED,"You dont have a Silencer attached!");
- if(GetPlayerWeapon(playerid) != 23)
- return SendClientMessage(playerid,COLOR_RED,"You are not holding a SD Pistol!");
- ammo = GetPlayerAmmo(playerid);
- GivePlayerWeapon(playerid,22,1);
- SetPlayerAmmo(playerid,WEAPON_COLT45,ammo);
- ApplyAnimation(playerid,"BUDDY","buddy_reload",4.1,0,1,1,1,1000,1);
- p_SilencerAttached[playerid] = 0;
- return true;
- }
- CMD:attachsilencer(playerid,params[])
- {
- #pragma unused params
- new ammo;
- if(p_Silencer[playerid] == 0)
- return SendClientMessage(playerid,COLOR_RED,"You dont own a silencer!");
- if(GetPlayerWeapon(playerid) != 22)
- return SendClientMessage(playerid,COLOR_RED,"You need to hold a 9MM in order to do this!");
- ammo = GetPlayerAmmo(playerid);
- GivePlayerWeapon(playerid,23,1);
- SetPlayerAmmo(playerid,WEAPON_SILENCED,ammo);
- ApplyAnimation(playerid,"BUDDY","buddy_reload",4.1,0,1,1,1,1000,0);
- p_SilencerAttached[playerid] = 1;
- return true;
- }
- CMD:buysilencer(playerid,params[])
- {
- #pragma unused params
- new string[64];
- if(GetPlayerMoney(playerid) < SILENCER_PRICE)
- return SendClientMessage(playerid,COLOR_RED,"You dont have enough money");
- if(p_Silencer[playerid] >= 1)
- return SendClientMessage(playerid,COLOR_RED,"You already have this upgrade!");
- p_Silencer[playerid] = 1;
- GivePlayerMoney(playerid, -SILENCER_PRICE);
- format(string,sizeof(string),"Notification: Silencer purchased for %i$",SILENCER_PRICE);
- SendClientMessage(playerid,COLOR_GREEN,string);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement