Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #include <gDialog>
- #include <pvehicle>
- #include <Dini>
- new Gate;
- new Gate2;
- new Gate3;
- new Gate4;
- new bool:AutoNOS[MAX_PLAYERS];
- #define PATH "Gany/Users/%s.ini"
- #define PlayerInfo_DB "Gany/Users/%s.ini"
- #define COLOR_GRAD1 0xB4B5B7FF
- #define COLOR_GRAD2 0xBFC0C2FF
- #define COLOR_GRAD3 0xCBCCCEFF
- #define COLOR_GRAD4 0xD8D8D8FF
- #define COLOR_GRAD5 0xE3E3E3FF
- #define COLOR_GRAD6 0xF0F0F0FF
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_FADE1 0xE6E6E6E6
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_FADE5 0x6E6E6E6E
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COLOR_DBLUE 0x2641FEAA
- #define COLOR_ALLDEPT 0xFF8282AA
- #define COL_LIGHTBLUE "{00CED1}"
- new CP[MAX_PLAYERS];
- enum PlayerDB
- {
- Kills,
- Deaths,
- bool:Box,
- }
- new PlayerData[MAX_PLAYERS][PlayerDB];
- forward StatsInfromation();
- new Text: PlayerStats[MAX_PLAYERS];
- new Text: Textdraw1;
- stock Save(playerid)
- {
- new FileDB[68];
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name , sizeof(Name));
- format(FileDB, sizeof(FileDB) , PlayerInfo_DB , Name);
- dini_IntSet(FileDB, "Kills" , PlayerData[playerid][Kills]);
- dini_IntSet(FileDB, "Deaths" , PlayerData[playerid][Deaths]);
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(CP[playerid] == 1)
- {
- DisablePlayerCheckpoint(playerid);
- SendClientMessage(playerid, 0xFFFFFFFF, "Dung Lenh /vaokhocs de lay do.");
- return 1;
- }
- if(CP[playerid] == 2)
- {
- DisablePlayerCheckpoint(playerid);
- SendClientMessage(playerid, 0xFFFFFFFF, "Dung Lenh /vaokhocuop de lay do.");
- return 1;
- }
- if(CP[playerid] == 3)
- {
- DisablePlayerCheckpoint(playerid);
- GivePlayerMoney(playerid, 2000);
- GivePlayerWeapon(playerid, 30, 99999);
- SendClientMessage(playerid,0x33AA33AA,"Ban Lam Viec Rat Tot Va Nhan Duoc 1 AK-47 Full Ammo + 2000$");
- }
- return 1;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Gany Gamemode LOADED");
- print("----------------------------------\n");
- }
- public OnGameModeInit()
- {
- SetGameModeText("GANY MODE v1.0");
- AddPlayerClass(285,1956.3945,1343.0414,15.3746,266.8986,0,0,0,0,0,0);
- CreateDialog(4,DIALOG_STYLE_LIST,"Vu khi", "9mm\ns9mm\nDesert Eagle\nShotgun\nSawoffShotgun\nCombat Shotgun\nUzi\nMp5\nAK-47\nM4\nTec-9\nCountry Rifle\nSniper Rifle\nCamera\nParachute", "Chon", "Dong");
- CreateDialog(5,DIALOG_STYLE_LIST,"Nhac", "E'-karik\nFA-Justatee", "Chon", "Dong");
- CreateDialog(6,DIALOG_STYLE_LIST,"Kho", "Mau\nGiap", "Chon", "Dong");
- CreateDialog(7,DIALOG_STYLE_LIST,"Xe", "Cheetah\nBanshee\nInfernus\nTurismo\nNRG-500", "Chon", "Dong");
- //===============================Stats=================================
- SetTimer("StatsInfromation",300 , 1);
- for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
- {
- PlayerStats[playerid] = TextDrawCreate(231.000000,405.000000,"-");
- Textdraw1 = TextDrawCreate(260.000000,391.000000,"STATS");
- TextDrawUseBox(PlayerStats[playerid],1);
- TextDrawBoxColor(PlayerStats[playerid],0xffffff33);
- TextDrawTextSize(PlayerStats[playerid],389.000000,119.000000);
- TextDrawAlignment(PlayerStats[playerid],0);
- TextDrawAlignment(Textdraw1,0);
- TextDrawBackgroundColor(PlayerStats[playerid],0x000000ff);
- TextDrawBackgroundColor(Textdraw1,0xff000033);
- TextDrawFont(PlayerStats[playerid],2);
- TextDrawLetterSize(PlayerStats[playerid],0.399999,1.200000);
- TextDrawFont(Textdraw1,2);
- TextDrawLetterSize(Textdraw1,0.799999,1.300000);
- TextDrawColor(PlayerStats[playerid],0xffffffff);
- TextDrawColor(Textdraw1,0xffffffff);
- TextDrawSetOutline(PlayerStats[playerid],1);
- TextDrawSetOutline(Textdraw1,1);
- TextDrawSetProportional(PlayerStats[playerid],1);
- TextDrawSetProportional(Textdraw1,1);
- TextDrawSetShadow(PlayerStats[playerid],1);
- TextDrawSetShadow(Textdraw1,1);
- Save(playerid);
- }
- return 1;
- }
- public OnGameModeExit()
- {
- for(new i = 0;i < MAX_PLAYERS; i++)
- {
- TextDrawDestroy(PlayerStats[i]);
- }
- TextDrawDestroy(Textdraw1);
- return 1;
- }
- CMD:aobay(playerid, params[])
- {
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
- return 1;
- }
- CMD:nitro(playerid, params[])
- {
- if(AutoNOS[playerid])
- {
- SendClientMessage(playerid, 0x924161FF, "[ ! ] Automatic nitro deactivated.");
- AutoNOS[playerid] = false;
- }
- else
- {
- SendClientMessage(playerid, 0x924161FF, "[ ! ] Automatic nitro activated!");
- AutoNOS[playerid] = true;
- }
- return 1;
- }
- CMD:suaxe(playerid,params[])
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
- RepairVehicle(GetPlayerVehicleID(playerid));
- SendClientMessage(playerid, COLOR_YELLOW, "Xe Da Duoc Sua Chua!");
- return 1;
- }
- CMD:xe(playerid, params[])
- {
- ShowPlayerDialog(playerid, 7);
- return 1;
- }
- CMD:thongtin(playerid,params[])
- {
- if(PlayerData[playerid][Box] == false)
- {
- PlayerData[playerid][Box] = true;
- TextDrawHideForPlayer(playerid, PlayerStats[playerid]);
- TextDrawHideForPlayer(playerid, Textdraw1);
- SendClientMessage(playerid, 0xFF000096,"Stats box off");
- }
- else
- {
- PlayerData[playerid][Box] = false;
- TextDrawShowForPlayer(playerid, PlayerStats[playerid]);
- TextDrawShowForPlayer(playerid, Textdraw1);
- SendClientMessage(playerid, 0xFF000096,"Stats box on");
- }
- return 1;
- }
- CMD:lamviec(playerid, params[])
- {
- CP[playerid] = 3;
- SetPlayerCheckpoint(playerid, -269.1287,2610.6057,63.2069, 3.0);
- SendClientMessage(playerid, 0xFFFFFFFF, "You started your first mission. Please follow the checkpoints");
- return 1;
- }
- CMD:afk(playerid, params[])
- {
- new pName[MAX_PLAYER_NAME];
- new string[128];
- GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
- format(string, sizeof(string), "---> #s now AFK!", pName);
- SendClientMessageToAll(COLOR_RED, string);
- TogglePlayerControllable(playerid, 0);
- SetPlayerHealth(playerid, 999999.99);
- return 1;
- }
- CMD:back(playerid, params[])
- {
- new pName[MAX_PLAYER_NAME];
- new string[128];
- GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
- format(string, sizeof(string), "---> #s now back!", pName);
- SendClientMessageToAll(COLOR_GREEN, string);
- TogglePlayerControllable(playerid, 1);
- SetPlayerHealth(playerid, 100);
- return 1;
- }
- CMD:lock(playerid, params[])
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new State=GetPlayerState(playerid);
- if(State!=PLAYER_STATE_DRIVER)
- {
- SendClientMessage(playerid,0xFF004040,"You can only lock the doors as the driver.");
- return 1;
- }
- new i;
- for(i=0;i<MAX_PLAYERS;i++)
- {
- if(i != playerid)
- {
- SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 1);
- }
- }
- SendClientMessage(playerid, 0x33AA33AA, "Vehicle locked!");
- new Float:pX, Float:pY, Float:pZ;
- GetPlayerPos(playerid,pX,pY,pZ);
- PlayerPlaySound(playerid,1056,pX,pY,pZ);
- }
- else
- {
- SendClientMessage(playerid, 0xFF004040, "You're not in a vehicle!");
- }
- return 1;
- }
- CMD:unlock(playerid, params[])
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new State=GetPlayerState(playerid);
- if(State!=PLAYER_STATE_DRIVER)
- {
- SendClientMessage(playerid,0xFF004040,"You can only unlock the doors as the driver.");
- return 1;
- }
- new i;
- for(i=0;i<MAX_PLAYERS;i++)
- {
- SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i, 0, 0);
- }
- SendClientMessage(playerid, 0x33AA33AA, "Vehicle unlocked!");
- new Float:pX, Float:pY, Float:pZ;
- GetPlayerPos(playerid,pX,pY,pZ);
- PlayerPlaySound(playerid,1057,pX,pY,pZ);
- }
- else
- {
- SendClientMessage(playerid, 0xFF004040, "You're not in a vehicle!");
- }
- return 1;
- }
- CMD:vukhi(playerid,params[])
- {
- ShowPlayerDialog(playerid, 4);
- return 1;
- }
- DIALOG:0(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(listitem == 0)
- {
- MoveObject(Gate, -2613.62598, -47.35040, -0.3000, 3);
- MoveObject(Gate2, -2613.60010, -43.02190, -0.3000, 3);
- }
- if(listitem == 1)
- {
- MoveObject(Gate, -2613.62598, -47.35040, 6.8800, 3);
- MoveObject(Gate2, -2613.60010, -43.02190, 6.8800, 3);
- }
- }
- return 1;
- }
- DIALOG:1(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid, 2);
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid, 3);
- }
- }
- return 1;
- }
- DIALOG:2(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(listitem == 0)
- {
- MoveObject(Gate3,-1572.23792, 658.81207, 6.86240,3,23.22000, -14.33999, 90.00000);
- }
- if(listitem == 1)
- {
- MoveObject(Gate3,-1572.2379, 658.8121, 6.86240,4,11.88000, 89.22003, 90.00000);
- }
- }
- return 1;
- }
- DIALOG:3(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(listitem == 0)
- {
- MoveObject(Gate4,-1701.37341, 687.62732, 24.74230,3,23.22000, -14.33999, 90.00000);
- }
- if(listitem == 1)
- {
- MoveObject(Gate4,-1701.37341, 687.62732, 24.74230,4,0.84000, -90.24000, 90.00000);
- }
- }
- return 1;
- }
- DIALOG:4(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(listitem == 0)
- {
- GivePlayerWeapon(playerid, 22, 9999);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With 9mm. Price Is 5000$!!");
- }
- if(listitem == 1)
- {
- GivePlayerWeapon(playerid, 23, 9999);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With s9mm. Price Is 10000$!!");
- }
- if(listitem == 2)
- {
- GivePlayerWeapon(playerid, 24, 9999);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Desert Eagle. Price Is 30000$!!");
- }
- if(listitem == 3)
- {
- GivePlayerWeapon(playerid, 25, 9999);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Shotgun. Price Is 20000$!!");
- }
- if(listitem == 4)
- {
- GivePlayerWeapon(playerid, 26, 9999);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With SawoffShotgun. Price Is 30000$!!");
- }
- if(listitem == 5)
- {
- GivePlayerWeapon(playerid, 27, 9999);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With CombatShotgun. Price Is 50000$!!");
- }
- if(listitem == 6)
- {
- GivePlayerWeapon(playerid, 28, 9999);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Uzi. Price Is 40000$!!");
- }
- if(listitem == 7)
- {
- GivePlayerWeapon(playerid, 29, 9999);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With MP5. Price Is 30000$!!");
- }
- if(listitem == 8)
- {
- GivePlayerWeapon(playerid, 30, 9999);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With AK-47. Price Is 50000$!!");
- }
- if(listitem == 9)
- {
- GivePlayerWeapon(playerid, 31, 9999);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With M4. Price Is 60000$!!");
- }
- if(listitem == 10)
- {
- GivePlayerWeapon(playerid, 32, 9999);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Tec-9. Price Is 40000$!!");
- }
- if(listitem == 11)
- {
- GivePlayerWeapon(playerid, 33, 9999);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Country Rifle. Price Is 30000$!!");
- }
- if(listitem == 12)
- {
- GivePlayerWeapon(playerid, 34, 9999);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Sniper Rifle. Price Is 100000$!!");
- }
- if(listitem == 13)
- {
- GivePlayerWeapon(playerid, 43, 9999);
- GivePlayerMoney(playerid, -2000);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Camera.");
- }
- if(listitem == 14)
- {
- GivePlayerWeapon(playerid, 46, 1);
- SendClientMessage(playerid, COLOR_YELLOW, "Have Fun With Parachute.");
- }
- }
- return 1;
- }
- DIALOG:5(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(listitem == 0)
- {
- PlayAudioStreamForPlayer(playerid,"http://mp3.zing.vn/bai-hat/E-Karik-Windy-Quyen/ZW668B9F.html");
- SendClientMessage(playerid, COLOR_GREEN, "Ban Da Mo Radio Bai Hat E'-Karik");
- }
- if(listitem == 1)
- {
- PlayAudioStreamForPlayer(playerid,"http://mp3.zing.vn/download/song/Forever-Alone-JustaTee/ZHJGyZHaSpHWEcNtLvxTFHkm");
- SendClientMessage(playerid, COLOR_GREEN, "Ban Da Mo Radio Bai Hat FA-Justatee");
- }
- }
- return 1;
- }
- DIALOG:6(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(listitem == 0)
- {
- SetPlayerHealth(playerid,100);
- }
- if(listitem == 1)
- {
- SetPlayerArmour(playerid,100);
- }
- }
- return 1;
- }
- DIALOG:7(playerid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(listitem == 0)
- {
- CreateVehicleForPlayer(playerid, "415", 2, 2, 1000);
- }
- if(listitem == 1)
- {
- CreateVehicleForPlayer(playerid, "429", 3, 0, 1000);
- }
- if(listitem == 2)
- {
- CreateVehicleForPlayer(playerid, "411", 1, 1, 1000);
- }
- if(listitem == 3)
- {
- CreateVehicleForPlayer(playerid, "451", 6, 6, 1000);
- }
- if(listitem == 4)
- {
- CreateVehicleForPlayer(playerid, "522", 3, 6, 1000);
- }
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new FileDB[68];
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name , sizeof(Name));
- format(FileDB,sizeof(FileDB) , PlayerInfo_DB ,Name);
- if(!dini_Exists(FileDB))
- {
- dini_Create(FileDB);
- dini_Set(FileDB, "Name" ,Name);
- dini_IntSet(FileDB, "Kills" ,0);
- dini_IntSet(FileDB, "Deaths" ,0);
- }
- PlayerData[playerid][Kills] = dini_Int(FileDB,"Kills");
- PlayerData[playerid][Deaths] = dini_Int(FileDB,"Deaths");
- TextDrawShowForPlayer(playerid, PlayerStats[playerid]);
- TextDrawShowForPlayer(playerid, Textdraw1);
- SendClientMessage(playerid, 0xFF000096,"Server Dung Phan Mem Hien Giet/Chet System");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new FileDB[68];
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name , sizeof(Name));
- format(FileDB, sizeof(FileDB) , PlayerInfo_DB , Name);
- dini_IntSet(FileDB, "Kills" , PlayerData[playerid][Kills]);
- dini_IntSet(FileDB, "Deaths" , PlayerData[playerid][Deaths]);
- PlayerData[playerid][Kills] = 0;
- PlayerData[playerid][Deaths] = 0;
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new FileDB[68];
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name , sizeof(Name));
- format(FileDB,sizeof(FileDB) , PlayerInfo_DB , Name);
- dini_IntSet(FileDB, "Giet" , PlayerData[playerid][Kills]);
- dini_IntSet(FileDB, "Chet" , PlayerData[playerid][Deaths]);
- PlayerData[killerid][Kills] ++;
- PlayerData[playerid][Deaths] ++;
- return 1;
- }
- public StatsInfromation()
- {
- new str[128];
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- if (IsPlayerConnected(i))
- {
- format(str, sizeof(str), "Giet: %d - Chet: %d" , PlayerData[i][Kills], PlayerData[i][Deaths]);
- TextDrawSetString(PlayerStats[i],str);
- }
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && AutoNOS[playerid] && (newkeys & KEY_ACTION || newkeys & KEY_FIRE)) AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement