SHOW:
|
|
- or go back to the newest paste.
1 | public OnPlayerDeath(playerid, killerid, reason) | |
2 | ||
3 | - | KillTimer(PlayerInfo[playerid][checkArea]); |
3 | + | |
4 | - | KillTimer(PlayerInfo[playerid][checkHealth]); |
4 | + | KillTimer(PlayerInfo[playerid][checkArea]); |
5 | - | if(killerid != INVALID_PLAYER_ID && killerid != playerid) {SendDeathMessage(killerid, playerid, reason);} |
5 | + | KillTimer(PlayerInfo[playerid][checkHealth]); |
6 | if(killerid != INVALID_PLAYER_ID && killerid != playerid) | |
7 | { | |
8 | - | OnWeaponDrop(playerid); |
8 | + | SendDeathMessage(killerid, playerid, reason); |
9 | - | } |
9 | + | |
10 | - | if(PlayerInfo[playerid][teamInt] > 0) |
10 | + | |
11 | - | { |
11 | + | |
12 | - | SetPlayerTeam(playerid, PlayerInfo[playerid][teamInt]); |
12 | + | |
13 | OnWeaponDrop(playerid); | |
14 | - | SetPVarInt(playerid, "hasArmor", 0); |
14 | + | |
15 | - | SetPVarInt(playerid, "FP_LastPositionSet", tickcount()); |
15 | + | |
16 | - | PlayerInfo[playerid][inAndro]=0; |
16 | + | if(PlayerInfo[playerid][teamInt] > 0) |
17 | - | KillTimer(PlayerInfo[playerid][checkHealth]); |
17 | + | |
18 | - | if(PlayerInfo[playerid][atSpawn] == 1) {CallRemoteFunction("AntiSpawnkill", "i", playerid);} |
18 | + | |
19 | SetPlayerTeam(playerid, PlayerInfo[playerid][teamInt]); | |
20 | ||
21 | - | PlayerInfo[playerid][usingLoopAnim] = 0; |
21 | + | |
22 | - | TextDrawHideForPlayer(playerid,txtAnimHelper); |
22 | + | SetPVarInt(playerid, "hasArmor", 0); |
23 | SetPVarInt(playerid, "FP_LastPositionSet", tickcount()); | |
24 | PlayerInfo[playerid][inAndro]=0; | |
25 | KillTimer(PlayerInfo[playerid][checkHealth]); | |
26 | - | if(!IsVehicleAir(killerid, GetPlayerVehicleID(killerid)) && reason != 49 && reason != 50) |
26 | + | if(PlayerInfo[playerid][atSpawn] == 1) |
27 | - | { |
27 | + | |
28 | - | SetPlayerDrunkLevel(killerid, 5000); |
28 | + | CallRemoteFunction("AntiSpawnkill", "i", playerid); |
29 | - | new panels, doors, lights, tires; |
29 | + | |
30 | if(PlayerInfo[playerid][usingLoopAnim]) | |
31 | ||
32 | { | |
33 | PlayerInfo[playerid][usingLoopAnim] = 0; | |
34 | TextDrawHideForPlayer(playerid,txtAnimHelper); | |
35 | - | if(PlayerInfo[playerid][pKilled] > 2) {HandleCheater(playerid, "fake kill");} |
35 | + | |
36 | } | |
37 | if(IsPlayerInAnyVehicle(killerid)) | |
38 | ||
39 | { | |
40 | if(!IsVehicleAir(killerid, GetPlayerVehicleID(killerid)) && reason != 49 && reason != 50) | |
41 | - | cInfo[playerid][bombArmed] = 0; |
41 | + | |
42 | - | cInfo[playerid][hasBelt] = 0; |
42 | + | |
43 | - | cInfo[playerid][usedDrugs] = 0; |
43 | + | SetPlayerDrunkLevel(killerid, 5000); |
44 | - | cInfo[playerid][mPlanted] = 0; |
44 | + | new panels, doors, lights, tires; |
45 | - | DestroyDynamicPickup(cInfo[playerid][mFoot]); |
45 | + | |
46 | - | DestroyDynamicPickup(cInfo[playerid][mVeh]); |
46 | + | |
47 | - | DestroyDynamicObject(cInfo[playerid][spike][0]); |
47 | + | |
48 | } | |
49 | ||
50 | } | |
51 | - | KillTimer(samTimer[playerid]); |
51 | + | |
52 | - | return 1; |
52 | + | if(PlayerInfo[playerid][pKilled] > 2) |
53 | { | |
54 | HandleCheater(playerid, "fake kill"); | |
55 | } | |
56 | return 1; | |
57 | ||
58 | } | |
59 | - | SendMessage(playerid, COLOR_RED, "Robbery failed.","Ia?aaeaiea i?iaaeaii."); |
59 | + | |
60 | - | caligulaRobbery = 0; |
60 | + | |
61 | - | RobbingCaligulas[playerid] = 0; |
61 | + | |
62 | - | TogglePlayerDynamicCP(playerid, finishCheck1, 0); |
62 | + | |
63 | - | KillTimer(robtimer[playerid]); |
63 | + | cInfo[playerid][bombArmed] = 0; |
64 | - | DestroyDynamicMapIcon(finishIcon[playerid]); |
64 | + | cInfo[playerid][hasBelt] = 0; |
65 | cInfo[playerid][usedDrugs] = 0; | |
66 | cInfo[playerid][mPlanted] = 0; | |
67 | DestroyDynamicPickup(cInfo[playerid][mFoot]); | |
68 | - | SendMessage(playerid, COLOR_RED, "Robbery failed.","Ia?aaeaiea i?iaaeaii."); |
68 | + | DestroyDynamicPickup(cInfo[playerid][mVeh]); |
69 | - | dragonRobbery = 0; |
69 | + | DestroyDynamicObject(cInfo[playerid][spike][0]); |
70 | - | RobbingDragons[playerid] = 0; |
70 | + | |
71 | - | TogglePlayerDynamicCP(playerid, finishCheck1, 0); |
71 | + | |
72 | - | KillTimer(robtimer[playerid]); |
72 | + | |
73 | - | DestroyDynamicMapIcon(finishIcon[playerid]); |
73 | + | KillTimer(samTimer[playerid]); |
74 | return 1; | |
75 | ||
76 | } | |
77 | - | SendMessage(playerid, COLOR_RED, "Robbery failed.","Ia?aaeaiea i?iaaeaii."); |
77 | + | |
78 | - | clownRobbery = 0; |
78 | + | |
79 | - | RobbingClowns[playerid] = 0; |
79 | + | |
80 | - | TogglePlayerDynamicCP(playerid, finishCheck1, 0); |
80 | + | |
81 | - | KillTimer(robtimer[playerid]); |
81 | + | |
82 | - | DestroyDynamicMapIcon(finishIcon[playerid]); |
82 | + | |
83 | { | |
84 | SendMessage(playerid, COLOR_RED, "Robbery failed.","Ia?aaeaiea i?iaaeaii."); | |
85 | caligulaRobbery = 0; | |
86 | - | new string[128],string2[128]; |
86 | + | RobbingCaligulas[playerid] = 0; |
87 | - | new pName[24]; |
87 | + | TogglePlayerDynamicCP(playerid, finishCheck1, 0); |
88 | - | GetPlayerName(killerid, pName, 24); |
88 | + | KillTimer(robtimer[playerid]); |
89 | - | GivePlayerCash(killerid, ROBBERY_REWARD / 2); |
89 | + | DestroyDynamicMapIcon(finishIcon[playerid]); |
90 | - | format(string,sizeof(string),"[Team]%s has stopped the robbery and gets %d in reward.", pName, ROBBERY_REWARD / 2); |
90 | + | |
91 | - | format(string2,sizeof(string2),"[Team]%s inoaiiaee ia?aaeaiea e iieo?ee %d a ea?anoaa iaa?aau.", pName, ROBBERY_REWARD / 2); |
91 | + | |
92 | - | SendMessageToTeam(playerid, 4, COLOR_BLUE, string,string2); |
92 | + | |
93 | ||
94 | { | |
95 | SendMessage(playerid, COLOR_RED, "Robbery failed.","Ia?aaeaiea i?iaaeaii."); | |
96 | - | new string[128],string2[128]; |
96 | + | dragonRobbery = 0; |
97 | - | new pName[24]; |
97 | + | RobbingDragons[playerid] = 0; |
98 | - | GetPlayerName(killerid, pName, 24); |
98 | + | TogglePlayerDynamicCP(playerid, finishCheck1, 0); |
99 | - | GivePlayerCash(killerid, ROBBERY_REWARD / 2); |
99 | + | KillTimer(robtimer[playerid]); |
100 | - | format(string,sizeof(string),"[Team]%s has stopped the robbery and gets %d in reward.", pName, ROBBERY_REWARD / 2); |
100 | + | DestroyDynamicMapIcon(finishIcon[playerid]); |
101 | - | format(string2,sizeof(string2),"[Team]%s inoaiiaee ia?aaeaiea e iieo?ee %d a ea?anoaa iaa?aau.", pName, ROBBERY_REWARD / 2); |
101 | + | |
102 | - | SendMessageToTeam(playerid, 5, COLOR_BLUE, string,string2); |
102 | + | |
103 | if(RobbingClowns[playerid] == 1) | |
104 | ||
105 | { | |
106 | SendMessage(playerid, COLOR_RED, "Robbery failed.","Ia?aaeaiea i?iaaeaii."); | |
107 | clownRobbery = 0; | |
108 | RobbingClowns[playerid] = 0; | |
109 | TogglePlayerDynamicCP(playerid, finishCheck1, 0); | |
110 | KillTimer(robtimer[playerid]); | |
111 | DestroyDynamicMapIcon(finishIcon[playerid]); | |
112 | ||
113 | - | { |
113 | + | |
114 | if(RobbingCaligulas[playerid] == 1 && GetPlayerTeam(killerid) == 4) | |
115 | ||
116 | { | |
117 | new string[128],string2[128]; | |
118 | new pName[24]; | |
119 | GetPlayerName(killerid, pName, 24); | |
120 | GivePlayerCash(killerid, ROBBERY_REWARD / 2); | |
121 | format(string,sizeof(string),"[Team]%s has stopped the robbery and gets %d in reward.", pName, ROBBERY_REWARD / 2); | |
122 | format(string2,sizeof(string2),"[Team]%s inoaiiaee ia?aaeaiea e iieo?ee %d a ea?anoaa iaa?aau.", pName, ROBBERY_REWARD / 2); | |
123 | SendMessageToTeam(playerid, 4, COLOR_BLUE, string,string2); | |
124 | ||
125 | } | |
126 | if(RobbingDragons[playerid] == 1 && GetPlayerTeam(killerid) == 5) | |
127 | ||
128 | { | |
129 | new string[128],string2[128]; | |
130 | new pName[24]; | |
131 | GetPlayerName(killerid, pName, 24); | |
132 | - | HidePlayerProgressBar(playerid, bar[playerid]); |
132 | + | GivePlayerCash(killerid, ROBBERY_REWARD / 2); |
133 | - | new nScore = GetPlayerScore(killerid); |
133 | + | format(string,sizeof(string),"[Team]%s has stopped the robbery and gets %d in reward.", pName, ROBBERY_REWARD / 2); |
134 | - | if(killerid != INVALID_PLAYER_ID) |
134 | + | format(string2,sizeof(string2),"[Team]%s inoaiiaee ia?aaeaiea e iieo?ee %d a ea?anoaa iaa?aau.", pName, ROBBERY_REWARD / 2); |
135 | - | { |
135 | + | SendMessageToTeam(playerid, 5, COLOR_BLUE, string,string2); |
136 | - | SetPlayerScore(killerid, nScore+1); |
136 | + | |
137 | - | PlayerInfo[killerid][pKills]++; |
137 | + | |
138 | TogglePlayerDynamicCP(playerid, caligulacheck, 1); | |
139 | TogglePlayerDynamicCP(playerid, dragoncheck, 1); | |
140 | TogglePlayerDynamicCP(playerid, clowncheck, 1); | |
141 | return 1; | |
142 | ||
143 | } | |
144 | - | SendMessage(playerid, COLOR_YELLOW, message1, message2); |
144 | + | |
145 | - | SetPlayerScore(killerid, nScore+2); |
145 | + | |
146 | ||
147 | - | format(message1, sizeof(message1), "%s has completed hit on %s for $%d", GetName(killerid), GetName(playerid), PlayerInfo[playerid][pContract]); |
147 | + | |
148 | - | format(message2, sizeof(message2), "%s oaee %s ca aiciaa?a?aaiea a $%d", GetName(killerid), GetName(playerid), PlayerInfo[playerid][pContract]); |
148 | + | |
149 | ||
150 | { | |
151 | JoinCount--; | |
152 | Joined[playerid] = false; | |
153 | - | TogglePlayerSpectating(playerid, 1); |
153 | + | |
154 | - | if(IsPlayerInAnyVehicle(killerid)) |
154 | + | |
155 | TextDrawHideForPlayer(playerid, EventText); | |
156 | CPProgess[playerid] = 0; | |
157 | KillTimer(InfoTimer[playerid]); | |
158 | SetPlayerVirtualWorld(playerid, 0); | |
159 | ||
160 | } | |
161 | KillTimer(TdmTimer[playerid]); | |
162 | SetPlayerInterior(playerid,0); | |
163 | TextDrawHideForPlayer(playerid,TdmText); | |
164 | if(BuildRace == playerid+1) BuildRace = 0; | |
165 | return 1; | |
166 | - | PlayerInfo[playerid][deathTimer] = SetTimerEx("DeathSpec",1000,1,"iid",playerid,killerid,reason); |
166 | + | |
167 | - | PlayerInfo[playerid][pDeaths]++; |
167 | + | |
168 | ||
169 | public OnPlayerDeath(playerid, killerid, reason) | |
170 | - | if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && PlayerInfo[x][specID] == playerid) {AdvanceSpectate(x);} |
170 | + | |
171 | { | |
172 | HidePlayerProgressBar(playerid, bar[playerid]); | |
173 | new nScore = GetPlayerScore(killerid); | |
174 | - | if(killerid == INVALID_PLAYER_ID) |
174 | + | if(killerid != INVALID_PLAYER_ID) |
175 | ||
176 | - | new string[128], string2[128]; |
176 | + | |
177 | - | new winnerid = inviterID[playerid]; |
177 | + | SetPlayerScore(killerid, nScore+1); |
178 | - | format(string,sizeof(string),"%s has won the duel against %s. Weapon: %s", GetName(winnerid), GetName(playerid), weaponNames(weap[playerid])); |
178 | + | PlayerInfo[killerid][pKills]++; |
179 | - | format(string2,sizeof(string2),"%s auea?ae iiaaeiie i?ioea %s. I?o?ea: %s", GetName(winnerid), GetName(playerid), weaponNames(weap[playerid])); |
179 | + | |
180 | } | |
181 | if(PlayerInfo[playerid][pContract] > 0 && killerid != INVALID_PLAYER_ID) | |
182 | ||
183 | { | |
184 | - | new string[128], string2[128]; |
184 | + | |
185 | - | new Float:winHealth; |
185 | + | |
186 | - | GetPlayerHealth(killerid, winHealth); |
186 | + | |
187 | SendMessage(playerid, COLOR_YELLOW, message1, message2); | |
188 | SetPlayerScore(killerid, nScore+2); | |
189 | GivePlayerCash(killerid, PlayerInfo[playerid][pContract]); | |
190 | format(message1, sizeof(message1), "%s has completed hit on %s for $%d", GetName(killerid), GetName(playerid), PlayerInfo[playerid][pContract]); | |
191 | format(message2, sizeof(message2), "%s oaee %s ca aiciaa?a?aaiea a $%d", GetName(killerid), GetName(playerid), PlayerInfo[playerid][pContract]); | |
192 | SendMessageToAll(COLOR_YELLOW, message1, message2); | |
193 | PlayerInfo[playerid][pContract] = 0; | |
194 | ||
195 | } | |
196 | PlayerInfo[playerid][pCount] = 6; | |
197 | TogglePlayerSpectating(playerid, 1); | |
198 | if(IsPlayerInAnyVehicle(killerid)) | |
199 | ||
200 | { | |
201 | PlayerSpectateVehicle(playerid, GetPlayerVehicleID(killerid)); | |
202 | PlayerInfo[playerid][specID] = killerid; | |
203 | PlayerInfo[playerid][specType] = ADMIN_SPEC_TYPE_VEHICLE; | |
204 | ||
205 | } | |
206 | else | |
207 | ||
208 | { | |
209 | PlayerSpectatePlayer(playerid, killerid); | |
210 | PlayerInfo[playerid][specID] = killerid; | |
211 | PlayerInfo[playerid][specType] = ADMIN_SPEC_TYPE_PLAYER; | |
212 | ||
213 | } | |
214 | PlayerInfo[playerid][deathTimer] = SetTimerEx("DeathSpec",1000,1,"iid",playerid,killerid,reason); | |
215 | PlayerInfo[playerid][pDeaths]++; | |
216 | foreach(new x: Player) | |
217 | ||
218 | { | |
219 | if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && PlayerInfo[x][specID] == playerid) | |
220 | { | |
221 | AdvanceSpectate(x); | |
222 | } | |
223 | ||
224 | } | |
225 | if(inDuel[playerid] == 1) | |
226 | ||
227 | { | |
228 | if(killerid == INVALID_PLAYER_ID) | |
229 | ||
230 | { | |
231 | new string[128], string2[128]; | |
232 | new winnerid = inviterID[playerid]; | |
233 | format(string,sizeof(string),"%s has won the duel against %s. Weapon: %s", GetName(winnerid), GetName(playerid), weaponNames(weap[playerid])); | |
234 | format(string2,sizeof(string2),"%s auea?ae iiaaeiie i?ioea %s. I?o?ea: %s", GetName(winnerid), GetName(playerid), weaponNames(weap[playerid])); | |
235 | SendMessageToAll(COLOR_BLUE, string, string2); | |
236 | DuelReset(playerid, winnerid); | |
237 | SpawnPlayer(winnerid); | |
238 | ||
239 | } | |
240 | new string[128], string2[128]; | |
241 | new Float:winHealth; | |
242 | GetPlayerHealth(killerid, winHealth); | |
243 | GivePlayerCash(killerid, DUEL_REWARD); | |
244 | format(string,sizeof(string),"%s has won the duel against %s with %f HP. Weapon: %s", GetName(killerid), GetName(playerid), winHealth, weaponNames(weap[killerid])); | |
245 | format(string2,sizeof(string2),"%s auea?ae iiaaeiie i?ioea %s n %f HP. I?o?ea: %s", GetName(killerid), GetName(playerid), winHealth, weaponNames(weap[killerid])); | |
246 | SendMessageToAll(COLOR_BLUE, string, string2); | |
247 | DuelReset(playerid, killerid); | |
248 | SpawnPlayer(killerid); | |
249 | ||
250 | } | |
251 | return 1; | |
252 | ||
253 | } |