Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <Dini>
- #include <dudb>
- //player info
- new Float:positionx;
- new Float:positiony;
- new Float:positionz;
- new skin;
- new money;
- new weed;
- new healthpack;
- new mp3;
- new dlic;
- //driveing school
- new dpick;
- //shops
- new shop1;
- //Color Defines
- #define COLOR_GRAD1 0xB4B5B7AA
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_GREEN 0x33AA33AA
- #define green 0x33FF33AA
- #define red 0xFF0000AA
- #define yellow 0xFFFF00AA
- #define grey 0xC0C0C0AA
- #define blue 0x2641FEAA
- #define orange 0xFF9900AA
- #define black 0x2C2727AA
- #define COLOR_PINK 0xFF66FFAA
- #define COLOR_BLUE 0x0000BBAA
- #define COLOR_PURPLE 0x800080AA
- #define COLOR_BLACK 0x000000AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_GREEN1 0x33AA33AA
- #define COLOR_BROWN 0xA52A2AAA
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Position saver by Jueix");
- print("--------------------------------------\n");
- //shop pick ups
- shop1 = CreatePickup(1274, 1, -23.5076, -55.1543, 1003.5469, -1);
- //driving school n pick upscars
- dpick = CreatePickup(1274, 1, 1173.1597, 1348.6721, 10.9219, -1);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- LoadStats(playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new Float:x;
- new Float:y;
- new Float:z;
- GetPlayerPos(playerid,x,y,z);
- skin = GetPlayerSkin(playerid);
- money = GetPlayerMoney(playerid);
- positionx = x;
- positiony = y;
- positionz = z;
- if (!dini_Exists(Pos(playerid)))
- {
- dini_Create(Pos(playerid));
- }
- SaveStats(playerid);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if (!dini_Exists(Pos(playerid))) {
- SetPlayerPos(playerid, 1676.8462, 1447.7908, 10.7833);
- GivePlayerMoney(playerid, 50000);
- }
- else
- {
- SetPlayerPos(playerid, positionx,positiony,positionz);
- SetPlayerSkin(playerid,skin);
- GivePlayerMoney(playerid,money);
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/mp3", cmdtext, true, 10) == 0) //Change this one to whatever you want.
- {
- if(mp3 >= 1) {
- ShowPlayerDialog(playerid,90,DIALOG_STYLE_LIST,"Mp3 player by jueix","1. Eppictv monster\r\n2. Eppic by no means\r\n3. Boyce avenue every breath\r\n4. FYRE STARTERZ we wont stop ","Select", "Cancel");//We use the line above to make the Dialog show, and as you notice we want DIALOG_STYLE_LIST because it will be a list so we can choose from.
- }
- else {
- SendClientMessage(playerid, red,"Error: You don't have a mp3 player");
- }
- return 1;
- }
- if (strcmp("/stopmusic", cmdtext, true, 10) == 0)
- {
- StopAudioStreamForPlayer(playerid);//This is the function we need to stop the audio from streaming the music.
- return 1;
- }
- //worlds
- if (strcmp("/musichelp", cmdtext, true, 10) == 0)
- {
- SendClientMessage(playerid, blue,"/mp3 to play a list of music and /stopmusic to stop");
- return 1;
- }
- if (strcmp("/weed", cmdtext, true, 10) == 0)
- {
- if(weed >= 1) {
- SendClientMessage(playerid, blue,"you smoke the weed");
- weed = weed-1;
- }
- else {
- SendClientMessage(playerid, red,"Error: You don't have any weed");
- }
- return 1;
- }
- if (strcmp("/healthpack", cmdtext, true, 10) == 0)
- {
- if(healthpack >= 1) {
- SendClientMessage(playerid, blue,"you put the bandages on");
- healthpack = healthpack-1;
- }
- else {
- SendClientMessage(playerid, red,"Error: You don't have a healthpack");
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if(dlic >= 1) {
- //
- }
- else
- {
- SendClientMessage(playerid, blue,"you don't have a driving lic go to the school to get one");
- }
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == shop1)
- {
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"shop","1. weed £25\r\n2. health £500 \r\n3. Mp3 player £1500","Select", "Cancel");
- }
- if(pickupid == dpick)
- if(dlic == 0) {
- GivePlayerMoney(playerid,-500);
- SendClientMessage(playerid,green,"you now have a driving license");
- dlic = 1;
- }
- else
- {
- SendClientMessage(playerid,green,"you aready have a driving license");
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case 90:
- {
- if(!response)
- {
- SendClientMessage(playerid, 0x42F3F198, "You canceled the dialog.");
- return 1;
- }
- switch(listitem)
- {
- case 0:
- {
- PlayAudioStreamForPlayer(playerid, "http://k002.kiwi6.com/hotlink/4sbcq95h9i/paramore_monster_eppic_and_alex_g_cover.mp3");
- SendClientMessage(playerid, 0x42F3F198, "Type /stopmusic to stop audio streaming.");
- }
- case 1:
- {
- PlayAudioStreamForPlayer(playerid, "http://k002.kiwi6.com/hotlink/p4t199hze3/eppic_feat_lindsey_stirling_by_no_means_original_song.mp3");//This function will play our desired radio. So we have to put the url between its brackets.
- SendClientMessage(playerid, 0x42F3F198, "Type /stopmusic to stop audio streaming.");
- }
- case 2:
- {
- PlayAudioStreamForPlayer(playerid, "http://k002.kiwi6.com/hotlink/o8gr9q3g0c/boyce_avenue_every_breath.mp3");
- SendClientMessage(playerid, 0x42F3F198, "Type /stopmusic to stop audio streaming.");
- }
- case 3:
- {
- PlayAudioStreamForPlayer(playerid, "http://k003.kiwi6.com/hotlink/34le71lfyp/fyre_starterz_we_won_t_stop.mp3");
- SendClientMessage(playerid, 0x42F3F198, "Type /stopmusic to stop audio streaming.");
- }
- //You can continue cases here but make sure you make a new line in the ShowPlayerDialog on /mp3 command \r\n4. 4th \r\n5. 5th channel etc..
- }
- }
- }
- switch(dialogid)
- {
- case 1:
- {
- if(!response)
- {
- SendClientMessage(playerid, 0x42F3F198, "Thanks come back soon.");
- return 1;
- }
- switch(listitem)
- {
- case 0:
- {
- GivePlayerMoney(playerid,-25);
- weed = weed+1;
- SendClientMessage(playerid, 0x42F3F198, "You have bought some weed type /weed to smoke it");
- }
- case 1:
- {
- GivePlayerMoney(playerid, -500);
- healthpack = healthpack+1;
- SendClientMessage(playerid, 0x42F3F198, "You have bought a health kit type /health to use it");
- }
- case 2:
- {
- GivePlayerMoney(playerid, -1500);
- mp3 = 1;
- SendClientMessage(playerid, 0x42F3F198, "You have bought a mp3 player type /mp3 to use it");
- }
- //You can continue cases here but make sure you make a new line in the ShowPlayerDialog on shop1 in pickup command \r\n4. 4th \r\n5. 5th channel etc..
- }
- }
- }
- return 1;
- }
- Player(playerid)
- {
- new player[MAX_PLAYER_NAME];
- GetPlayerName(playerid, player, sizeof(player));
- return player;
- }
- Pos(playerid)
- {
- new a[256]; format(a, sizeof(a), "%s.ini",udb_encode(Player(playerid)));
- return a;
- }
- SaveStats(playerid)
- {
- dini_IntSet(Pos(playerid), "PositionX", floatround(positionx));
- dini_IntSet(Pos(playerid), "PositionY", floatround(positiony));
- dini_IntSet(Pos(playerid), "PositionZ", floatround(positionz));
- dini_IntSet(Pos(playerid), "skin", (skin));
- dini_IntSet(Pos(playerid), "money", (money));
- dini_IntSet(Pos(playerid), "weed", (weed));
- dini_IntSet(Pos(playerid), "healthpack", (healthpack));
- dini_IntSet(Pos(playerid), "dlic", (dlic));
- }
- LoadStats(playerid)
- {
- positionx = dini_Int(Pos(playerid), "PositionX");
- positiony = dini_Int(Pos(playerid), "PositionY");
- positionz = dini_Int(Pos(playerid), "PositionZ");
- skin = dini_Int(Pos(playerid), "skin");
- money = dini_Int(Pos(playerid), "money");
- weed = dini_Int(Pos(playerid), "weed");
- healthpack = dini_Int(Pos(playerid), "healthpack");
- dlic = dini_Int(Pos(playerid), "dlic");
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Blank Gamemode by Jueix");
- print("----------------------------------\n");
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment