View difference between Paste ID: bWk2LHUd and SZMQ3WMH
SHOW: | | - or go back to the newest paste.
1
#include 	<a_samp>
2
#include 	<zcmd>
3
#define		MAX_HOLES	700
4-
#include	<streamer>
4+
5
enum hInfo
6
{
7
	hCreated,
8
	Float:hX,
9
    Float:hY,
10
    Float:hZ,
11
    hCount,
12
    hObject,
13
};
14
new HoleInfo[MAX_HOLES][hInfo];
15
16
public OnFilterScriptInit()
17
{
18
    for(new i; i < MAX_HOLES; i++) { i = 0; return 1;}
19
	print("\n--------------------------------------");
20
	print(" Blank Filterscript by your name here");
21
	print("--------------------------------------\n");
22
	return 1;
23
}
24
25
stock CreateHole(Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:Angle)
26
{
27
    for(new i = 0; i < sizeof(HoleInfo); i++)
28
  	{
29
  	    if(HoleInfo[i][hCreated] == 0)
30
  	    {
31
            HoleInfo[i][hCreated]=1;
32
            HoleInfo[i][hX]=x;
33
            HoleInfo[i][hY]=y;
34
            HoleInfo[i][hZ]=z;
35
            HoleInfo[i][hObject] = CreateObject(19185, x, y, z, rx, ry, Angle);
36
			HoleInfo[i][hCount] += 1;
37-
            HoleInfo[i][hObject] = CreateObject(3106, x, y, z, rx, ry, Angle);
37+
38
	        return 1;
39
  	    }
40
  	    if(HoleInfo[i][hCount] == MAX_HOLES) { return DeleteAllHoles(); }
41
  	}
42
  	return 0;
43
}
44
45
CMD:clear(playerid, params[])
46
{
47
	DeleteAllHoles();
48
	return 1;
49
}
50
51
stock DeleteAllHoles()
52
{
53
    for(new i = 0; i < sizeof(HoleInfo); i++)
54
  	{
55
  	    if(HoleInfo[i][hCreated] == 1)
56
  	    {
57
  	        HoleInfo[i][hCreated]=0;
58
            HoleInfo[i][hX]=0.0;
59
            HoleInfo[i][hY]=0.0;
60
            HoleInfo[i][hZ]=0.0;
61
			HoleInfo[i][hCount] = 0;
62
            DestroyObject(HoleInfo[i][hObject]);
63
  	    }
64
	}
65
    return 0;
66
}
67
68
69
public OnFilterScriptExit()
70
{
71
	return 1;
72
}
73
74
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
75
{
76
    new Float:a;
77
    GetPlayerPos(playerid, x, y, a);
78
    GetPlayerFacingAngle(playerid, a);
79
    if (GetPlayerVehicleID(playerid))
80
    {
81
      GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
82
    }
83
    x += (distance * floatsin(-a, degrees));
84
    y += (distance * floatcos(-a, degrees));
85
}
86
87
CMD:gun(playerid, params[])
88
{
89
	GivePlayerWeapon(playerid, 24, 100);
90
	GivePlayerWeapon(playerid, 34, 100);
91
	GivePlayerWeapon(playerid, 38, 100);
92
	return 1;
93
}
94
95
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
96
{
97
	if(weaponid == 37 || weaponid == 36 || weaponid == 35) return 1;
98
    else{
99-
	if(weaponid == 38 || weaponid == 37 || weaponid == 36 || weaponid == 35) return 1;
99+
100
	    {
101
	        new Float: A, Float: rX, Float: rY;
102
	        GetXYInFrontOfPlayer(playerid, rX, rY, 5.0);
103
	        GetPlayerFacingAngle(playerid, A);
104
			CreateHole(fX, fY, fZ, rX, rY, A-90);
105
		}
106
	}
107
	return 1;
108
}