View difference between Paste ID: m10HmY9b and tPJ4rTKc
SHOW: | | - or go back to the newest paste.
1-
// This is a comment
1+
 new MoneyPickup,m;
2-
    // uncomment the line below if you want to write a filterscript
2+
3-
    //#define FILTERSCRIPT
3+
4
    new location[128];
5
    new nearest[128];
6
    new nearestplayer,nearplayername[128];
7-
    ********************************************************************************
7+
8-
                                                    Money Bag Event - Version 1.0
8+
9-
                                                            Author - DeathGuise / AaronFarley
9+
10
11-
                                            Thanks To Jimmy0wnz, BroZeus and AceFlyer For Testing
11+
12-
                                                The Script And Fixing Bugs
12+
13
    new timer_mb_3;
14-
                                                Please Do Not Remove The Credits Or
14+
15-
                                                                    Redistrubate.
15+
16
17
    new bool:iseventstarted = false;
18-
                                                            Required Includes And Plugins
18+
19-
                                                            ------------------------------
19+
20-
                                                    ZCMD - ZEEK (Fast and Great Command Processor)
20+
21-
                                                    Streamer - Incognito
21+
22-
                                                    ForEach - Y_Less A.K.A. ColeMiner
22+
23
            Float:Z,
24-
    ********************************************************************************
24+
25
            area[128],
26
            loc[128]
27
    }
28
    /*
29-
    #include <a_samp>
29+
30-
    #include <zcmd>
30+
31-
    #include <streamer>
31+
32-
    #include <foreach>
32+
33
    SavedPositions.Txt.
34-
    #if defined FILTERSCRIPT
34+
35
    Copy the X Y Z Cords and paste them into the first 3 sections. After that add the contents value.
36-
    public OnFilterScriptInit()
36+
37
38
    To make it easier I have added some already done for you.
39-
    print("******************************************************************************** ");
39+
40-
    print("                                         Money Bag Event - Version 1.0 Loaded                                            ");
40+
41-
	print("                                                 Author - DeathGuise     / AaronFarley                                           ");
41+
42-
    print("                                                                                                                                                                 ");
42+
43-
    print("                                 Thanks To Jimmy0wnz, BroZeus and AceFlyer For Testing"                                   ");
43+
44-
 	print("                                     The Script And Fixing Bugs                                                          ");
44+
45-
  	print("                                                                                                                                                                 ");
45+
46-
  	print("                                     Please Do Not Remove The Credits Or                                                 ");
46+
47-
  	print("                                                         Redistrubate.                                                                           ");
47+
48-
  	print("******************************************************************************** ");
48+
49-
   iseventstarted = false;
49+
50
            {-2528.2793,-1025.5176,102.1070,18076,"San Fierro","Mt Chilliad"},
51-
           return 1;
51+
52-
   }
52+
53
            {-1956.4731,764.5522,55.7254,13998,"San Fierro","Downtown"},
54-
   public OnFilterScriptExit()
54+
55-
   {
55+
56-
 		print("******************************************************************************   ");
56+
57-
   		print("                                         Money Bag Event - Version 1.0 UnLoaded                                          ");
57+
58-
   		print("                                                 Author - DeathGuise  / AaronFarley                                           ");
58+
59-
   		print("                                                                                                                                                                 ");
59+
60-
   		print("                                 Thanks To Jimmy0wnz and AceFlyer For Testing"                                   ");
60+
61-
    	print("                                     The Script And Fixing Bugs                                                          ");
61+
62-
	    print("                                                                                                                                                                 ");
62+
63-
	    print("                                     Please Do Not Remove The Credits Or                                                 ");
63+
64-
	    print("                                                         Redistrubate.                                                                           ");
64+
65-
	    print("******************************************************************************** ");
65+
66
            {471.4406,-269.6804,7.3002,41022,"Los Santos","Red County"},
67
            {1271.9558,295.4855,20.6563,21011,"Los Santos","Montgomery"},
68
            {2189.4036,-697.5020,56.4319,39012,"Los Santos","Red County"},
69-
    #else
69+
70
            {2274.2246,-2563.0544,19.9043,29052,"Los Santos","Ocean Docks"},
71-
    main()
71+
72
            {1024.0765,-313.3355,73.9931,22098,"Los Santos","Hilltop Farm"},
73-
            print("\n----------------------------------");
73+
74-
            print(" Blank Gamemode by your name here");
74+
75-
            print("----------------------------------\n");
75+
76
            {2581.4714,-1473.8392,24.0000,13062,"Los Santos","East Los Santos"},
77
            {2438.9673,-1901.5713,13.5534,17822,"Los Santos","Willowfield"},
78-
    #endif
78+
79
            {2545.9392,-2248.8154,13.5469,23091,"Los Santos","Ocean Docks"},
80-
    new MoneyPickup,m;
80+
81
            {664.9876,-1380.3512,21.8417,19872,"Los Santos","Vinewood"},
82
            {588.3129,-1555.4790,15.6424,20112,"Los Santos","Rodeo"},
83
            {459.0752,-1276.6705,15.4114,19221,"Los Santos","Richman"},
84
            {770.7070,-1084.6780,24.0859,22041,"Los Santos","Richman"},
85
            {1435.1244,-1093.3391,17.5879,16822,"Los Santos","Downtown"},
86
            {2792.7664,698.0993,9.8893,23659,"Las Venturas","Rockshore East"},
87
            {2892.5449,948.4681,10.6730,39621,"Las Venturas","Linden Side"},
88
            {2345.3472,1293.8081,67.4688,27001,"Las Venturas","The Camels Toe"},
89
            {2243.4036,1131.7672,10.8203,26822,"Las Venturas","Come-A-Lot"},
90
            {-781.4629,2147.3931,60.3828,28711,"Las Venturas","Sherman Dam"},
91
            {-86.8024,2642.1128,58.6177,36081,"Las Venturas","Bone County"},
92
            {384.6790,2435.0015,16.5000,22901,"Las Venturas","Verdant Meadows"},
93
            {826.2070,2665.7825,28.9297,40921,"Las Venturas","Bone County"},
94
            {1047.2354,2921.5979,48.3125,50982,"Las Venturas","Las Venturas"},
95
            {1400.8108,2767.2092,10.8203,51091,"Las Venturas","Las Venturas"},
96
            {2465.7429,2226.0747,10.8203,25002,"Las Venturas","Roca Escalante"},
97
            {2479.1763,1921.0494,10.4679,24069,"Las Venturas","Starfish Casino"},
98
            {1765.3286,592.7733,13.0000,18092,"Las Venturas","Red County"},
99
            {586.6403,392.7565,15.8715,1922,"Las Venturas","Fallow Bridge"},
100
            {1407.5444,2142.0837,12.0156,19112,"Las Venturas","Redsands West"},
101
            {2626.3064,2417.3677,10.8132,10921,"Las Venturas","Julius Thruway East"},
102
            {2879.5156,1595.7340,10.8203,11092,"Las Venturas","Sobell Rail Yards"},
103
            {2819.0471,1670.2314,10.8203,11021,"Las Venturas","Sobell Rail Yards"}
104
    };
105
106
    forward moneybag1();
107
    forward moneybag2();
108
    forward moneybag3();
109
    forward moneybag4();
110
    forward findnear();
111
112
  
113
114
    public OnPlayerRequestClass(playerid, classid)
115
    {
116
            SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
117
            SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
118
            SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
119
            return 1;
120
    }
121
122
    public OnPlayerConnect(playerid)
123
    {
124
            return 1;
125
    }
126
127
    public OnPlayerDisconnect(playerid, reason)
128
    {
129
            return 1;
130
    }
131
132
    public OnPlayerSpawn(playerid)
133
    {
134
            return 1;
135
    }
136
137
    public OnPlayerDeath(playerid, killerid, reason)
138
    {
139
            return 1;
140
    }
141
142
    public OnVehicleSpawn(vehicleid)
143
    {
144
            return 1;
145
    }
146
147
    public OnVehicleDeath(vehicleid, killerid)
148
    {
149
            return 1;
150
    }
151
152
    public OnPlayerText(playerid, text[])
153
    {
154
            return 1;
155
    }
156
157
    public OnPlayerCommandText(playerid, cmdtext[])
158
    {
159
            if (strcmp("/mycommand", cmdtext, true, 10) == 0)
160
            {
161
                    // Do something here
162
                    return 1;
163
            }
164
            return 0;
165
    }
166
167
    public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
168
    {
169
            return 1;
170
    }
171
172
    public OnPlayerExitVehicle(playerid, vehicleid)
173
    {
174
            return 1;
175
    }
176
177
    public OnPlayerStateChange(playerid, newstate, oldstate)
178
    {
179
            return 1;
180
    }
181
182
    public OnPlayerEnterCheckpoint(playerid)
183
    {
184
            return 1;
185
    }
186
187
    public OnPlayerLeaveCheckpoint(playerid)
188
    {
189
            return 1;
190
    }
191
192
    public OnPlayerEnterRaceCheckpoint(playerid)
193
    {
194
            return 1;
195
    }
196
197
    public OnPlayerLeaveRaceCheckpoint(playerid)
198
    {
199
            return 1;
200
    }
201
202
    public OnRconCommand(cmd[])
203
    {
204
            return 1;
205
    }
206
207
    public OnPlayerRequestSpawn(playerid)
208
    {
209
            return 1;
210
    }
211
212
    public OnObjectMoved(objectid)
213
    {
214
            return 1;
215
    }
216
217
    public OnPlayerObjectMoved(playerid, objectid)
218
    {
219
            return 1;
220
    }
221
222
    public OnPlayerPickUpPickup(playerid, pickupid)
223
    {
224
            return 1;
225
    }
226
227
    public OnVehicleMod(playerid, vehicleid, componentid)
228
    {
229
            return 1;
230
    }
231
232
    public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
233
    {
234
            return 1;
235
    }
236
237
    public OnVehicleRespray(playerid, vehicleid, color1, color2)
238
    {
239
            return 1;
240
    }
241
242
    public OnPlayerSelectedMenuRow(playerid, row)
243
    {
244
            return 1;
245
    }
246
247
    public OnPlayerExitedMenu(playerid)
248
    {
249
            return 1;
250
    }
251
252
    public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
253
    {
254
            return 1;
255
    }
256
257
    public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
258
    {
259
            return 1;
260
    }
261
262
    public OnRconLoginAttempt(ip[], password[], success)
263
    {
264
            return 1;
265
    }
266
267
    public OnPlayerUpdate(playerid)
268
    {
269
            return 1;
270
    }
271
272
    public OnPlayerStreamIn(playerid, forplayerid)
273
    {
274
            return 1;
275
    }
276
277
    public OnPlayerStreamOut(playerid, forplayerid)
278
    {
279
            return 1;
280
    }
281
282
    public OnVehicleStreamIn(vehicleid, forplayerid)
283
    {
284
            return 1;
285
    }
286
287
    public OnVehicleStreamOut(vehicleid, forplayerid)
288
    {
289
            return 1;
290
    }
291
292
    public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
293
    {
294
            return 1;
295
    }
296
297
    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
298
    {
299
            return 1;
300
    }
301
302
    public OnPlayerPickUpDynamicPickup(playerid, pickupid)
303
    {
304
            if(pickupid == MoneyPickup)
305
            {
306
                    new str[128];
307
                    new str2[128];
308
                    new Name[MAX_PLAYER_NAME];
309
                    GetPlayerName(playerid, Name, sizeof(Name));
310
                    format(str,sizeof(str),"%s(%d)has found the Moneybag And Recieved %i!",Name,playerid,MoneyBagPay);
311
                    SendClientMessageToAll(0xffccffaa,str);
312
                    format(str2,sizeof(str2),"You Found ~n~The MoneyBag ~n~And Got ~g~$%i",MoneyBagPay);
313
                    GivePlayerMoney(playerid,MoneyBagPay);
314
                    GameTextForPlayer(playerid,str2,3000,4);
315
                    DestroyDynamicPickup(MoneyPickup);//used to remove pickup
316
                    KillTimer(timer_mb_1);
317
                    KillTimer(timer_mb_2);
318
                    KillTimer(timer_mb_3);
319
                    KillTimer(timer_mb_4);
320
                    KillTimer(near_timer);
321
                    return 1;
322
            }
323
            else
324
            {
325
                    printf("Unknown Pickup Detected. Please Check Your Code");
326
                    return 1;
327
            }
328
329
    }
330
331
    public moneybag1()
332
    {
333
            SendClientMessageToAll(0xffccffaa,town);
334
            timer_mb_2=SetTimer("moneybag2", 60*3000, false);
335
    }
336
    public moneybag2()
337
    {
338
            SendClientMessageToAll(0xffccffaa,location);
339
            timer_mb_3=SetTimer("moneybag3", 60*3000, false);
340
    }
341
    public moneybag3()
342
    {       foreach(m:Player)
343
                        {distance=GetPlayerDistanceFromPoint(m,x,y,z);
344
                         if(distance < clos)
345
                         {
346
                         GetPlayerName(m,nearplayername,128);
347
                         clos=distance;
348
                         nearestplayer=m;
349
                        }}
350
                        format(nearest,128,"%s(%i) is currently located nearest to the hidden money bag.",nearplayername,nearestplayer);
351
            SendClientMessageToAll(0xffccffaa,nearest);
352
            timer_mb_4=SetTimer("moneybag4", 60*3000, false);
353
            near_timer=SetTimer("findnear",5,true);//change the value here for updating closest player time
354
    }
355
    
356
    public findnear()
357
    {foreach(m:Player)
358
                        {distance=GetPlayerDistanceFromPoint(m,x,y,z);
359
                         if(distance < clos)
360
                         {
361
                         GetPlayerName(m,nearplayername,128);
362
                         clos=distance;
363
                         nearestplayer=m;
364
365
                        }}
366
                        format(nearest,128,"%s(%i) is currently located nearest to the hidden money bag.",nearplayername,nearestplayer);
367
    }
368
369
370
    public moneybag4()
371
    {
372
            SendClientMessageToAll(0xffccffaa,"Nobody Collected The MoneyBag. It Has Been Eaten By A Deer");
373
            DestroyDynamicPickup(MoneyPickup);//used to remove pickup
374
            iseventstarted = false;
375
            KillTimer(near_timer);
376
            return 1;
377
    }
378
    
379
    /* You Will Need To Edit This Command To Work With Your Admin Script */
380
    CMD:moneybag(playerid,params[])
381
    {
382
    //I dont know your admin script so Edit this to allow your admin(s) to use the command
383
        //if(PlayerInfo[playerid][Admin] >= 1)
384
  //{
385
            if(iseventstarted == true)SendClientMessage(playerid,0xff0000ff,"The MoneyBag Event Has Already Started");
386
            else
387
            {
388
            		DestroyDynamicPickup(MoneyPickup); //used to remove last pickup used
389
             		new Rand = random(sizeof(MBagLocations));
390
                    x = MBagLocations[Rand][X];
391
                    y = MBagLocations[Rand][Y];
392
                    z = MBagLocations[Rand][Z];
393
                    MoneyBagPay = MBagLocations[Rand][Pay];
394
                    MoneyPickup = CreateDynamicPickup(1550, 2,x,y,z, -1, -1, -1, 1000.0);
395
                    SendClientMessageToAll(0xffccffaa,"The Money Bag Event Has Started.");
396
                    format(town,128, "The Money Bag Is Nearest To %s",MBagLocations[Rand][area]);
397
                    format(location, 128, "The Money Bag Is In %s",MBagLocations[Rand][loc]);
398
                    timer_mb_1=SetTimer("moneybag1", 60*3000, false);
399
                    iseventstarted = true;
400
            }
401
402
 // }
403
            return 1;
404
    }
405
    // Debug / Admin Command. By Default It Will Not Be Accesible To None RCON Admins
406
/*
407
408
    CMD:clue(playerid,params[])
409
    {
410
            SendClientMessage(playerid,0xffccffaa,town);
411
            SendClientMessage(playerid,0xffccffaa,location);
412
            return 1;
413
    }