Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Top Of Script
- //--[Weapons]
- new Text:WeaponDetails[MAX_PLAYERS];
- enum GunDrop
- {
- DropGunAmmount[2],
- DropObject,
- Float:DropGunPosX,
- Float:DropGunPosY,
- Float:DropGunPosZ,
- DropGunVirtualWorld,
- DropGunInterior,
- };
- new GunDropInfo[1000][GunDrop];
- new GunObjectIDs[200] ={
- 1575, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325, 326, 342, 343, 344, -1, -1 , -1 ,
- 346, 347, 348, 349, 350, 351, 352, 353, 355, 356, 372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367,
- 368, 369, 1575
- };
- main()
- {
- for(new playerid = 0;playerid < GetMaxPlayers();playerid++){
- //--[Weapon Details]
- WeaponDetails[playerid] = TextDrawCreate(110, 420, "Weapon");
- TextDrawBackgroundColor(WeaponDetails[playerid],0x00000033);
- TextDrawFont(WeaponDetails[playerid],3);
- TextDrawLetterSize(WeaponDetails[playerid],0.399999,1.700000);
- TextDrawColor(WeaponDetails[playerid],0xFFFFFFFF);
- TextDrawSetShadow(WeaponDetails[playerid],3);
- }
- stock DropGun(playerid, GunID, GunAmmo, Float:DX, Float:DY, Float:DZ, world, interior)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,sizeof(name));
- if(GunID != 0 && GunAmmo != 0)
- {
- for(new i = 0; i < sizeof(GunDropInfo); i++)
- {
- if(GunDropInfo[i][DropGunPosX] == 0.0 && GunDropInfo[i][DropGunPosY] == 0.0 && GunDropInfo[i][DropGunPosZ] == 0.0)
- {
- GunDropInfo[i][DropGunAmmount][0] = GunID;
- GunDropInfo[i][DropGunAmmount][1] = GunAmmo;
- GunDropInfo[i][DropGunPosX] = DX;
- GunDropInfo[i][DropGunPosY] = DY;
- GunDropInfo[i][DropGunPosZ] = DZ;
- GunDropInfo[i][DropGunVirtualWorld] = world;
- GunDropInfo[i][DropGunInterior] = interior;
- GunDropInfo[i][DropObject] = CreateDynamicObject(GetGunObjectID(GunID), DX, DY, DZ-1, 80.0, 0.0, 0.0, world);
- return 1;
- }
- }
- return 1;
- }
- return 1;
- }
- stock GetGunObjectID(WeaponID)
- {
- if (WeaponID < 0 || WeaponID > 64)
- {
- return 1575;
- }
- return GunObjectIDs[WeaponID];
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- }
- else
- {
- for(new i = 0; i < sizeof(GunDropInfo); i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0,GunDropInfo[i][DropGunPosX],GunDropInfo[i][DropGunPosY],GunDropInfo[i][DropGunPosZ]))
- {
- GameTextForPlayer(playerid,"~w~Pick Up Weapon: ~k~~SNEAK_ABOUT~!",1000,5);
- if(GetPlayerVirtualWorld(playerid) == GunDropInfo[i][DropGunVirtualWorld] && GetPlayerInterior(playerid) == GunDropInfo[i][DropGunInterior])
- {
- if(PRESSED(KEY_WALK))
- {
- DestroyDynamicObject(GunDropInfo[i][DropObject]);
- GunDropInfo[i][DropGunPosX] = 0.0;
- GunDropInfo[i][DropGunPosY] = 0.0;
- GunDropInfo[i][DropGunPosZ] = 0.0;
- GivePlayerWeapon(playerid,GunDropInfo[i][DropGunAmmount][0],GunDropInfo[i][DropGunAmmount][1]);
- return 1;
- }
- return 0;
- }
- }
- }
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- for(new i = 0; i < sizeof(GunDropInfo); i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0,GunDropInfo[i][DropGunPosX],GunDropInfo[i][DropGunPosY],GunDropInfo[i][DropGunPosZ]))
- {
- new string3[128];
- format(string3,sizeof string3,"~w~Weapon ID:%i Ammo:%i",GunDropInfo[i][DropGunAmmount][0],GunDropInfo[i][DropGunAmmount][1]);
- TextDrawSetString(WeaponDetails[playerid],string3);
- TextDrawShowForPlayer(playerid,WeaponDetails[playerid]);
- }
- else
- {
- TextDrawHideForPlayer(playerid,WeaponDetails[playerid]);
- }
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement