Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //|~~~~~~~~|==========================================|~~~~~~~~|
- //|~~~~~~~~| |By [HiC]Thekiller & ~CueBall~| |~~~~~~~~|
- //|~~~~~~~~|==========================================|~~~~~~~~|
- //------ includes
- #include <a_samp>
- #include <dutils>
- #include <DINI>
- #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1//-------level!
- new LVL[MAX_PLAYERS];
- new Kills[MAX_PLAYERS];
- #define LVL_SAVE//If you want the players level to save when they disconnect! If not comment it!
- #define LVL_WEPONS //Comment if you do not want any of the weapon/armor/health things on spawn ("//")!
- #define LVL_MESSAGE_COLOR 0x00B8FF
- //-------Level defines!
- #define LVL_1 0 //The Ammount of kills which at a player levels!
- #define LVL_2 25 //The Ammount of kills which at a player levels!
- #define LVL_3 1200 //The Ammount of kills which at a player levels!
- #define LVL_4 20000 //The Ammount of kills which at a player levels!
- #define LVL_5 250000 //The Ammount of kills which at a player levels!
- #define LVL_6 1000000 //The Ammount of kills which at a player levels!
- #define LVL_7 10000000//The Ammount of kills which at a player levels!
- #define LVL_8 500000000 //The Ammount of kills which at a player levels!
- #define LVL_9 1000000000//The Ammount of kills which at a player levels!
- #define LVL_10 100000000000 //The Ammount of kills which at a player levels!
- //=====================================
- //Leave bellow the same if you don't want to use or change if you do :P ;)
- #define LVL_1_WEAPON1 23 // Weapon 1 weapon ID!
- #define LVL_1_WEAPON1_AMMO 500 //Weapon1 ammo!
- #define LVL_1_WEAPON2 17 //Weapon2 weapon ID!
- #define LVL_1_WEAPON2_AMMO 5 //Weapon2 ammo!
- #define LVL_1_WEAPON3 7 //Weapon3 weapon ID!
- #define LVL_1_WEAPON3_AMMO 1 //Weapon 3 ammo
- #define LVL_1_HEALTH 50 // Health of that level!
- #define LVL_1_ARMOR 0 // Armor for that level!
- //-
- #define LVL_2_WEAPON1 22
- #define LVL_2_WEAPON1_AMMO 900
- #define LVL_2_WEAPON2 4
- #define LVL_2_WEAPON2_AMMO 1
- #define LVL_2_WEAPON3 8
- #define LVL_2_WEAPON3_AMMO 1
- #define LVL_2_HEALTH 60
- #define LVL_2_ARMOR 0
- //-
- #define LVL_3_WEAPON1 25
- #define LVL_3_WEAPON1_AMMO 450
- #define LVL_3_WEAPON2 5
- #define LVL_3_WEAPON2_AMMO 1
- #define LVL_3_WEAPON3 0
- #define LVL_3_WEAPON3_AMMO 0
- #define LVL_3_HEALTH 75
- #define LVL_3_ARMOR 0
- //-
- #define LVL_4_WEAPON1 24
- #define LVL_4_WEAPON1_AMMO 500
- #define LVL_4_WEAPON2 8
- #define LVL_4_WEAPON2_AMMO 1
- #define LVL_4_WEAPON3 0
- #define LVL_4_WEAPON3_AMMO 1
- #define LVL_4_HEALTH 85
- #define LVL_4_ARMOR 0
- //-
- #define LVL_5_WEAPON1 26
- #define LVL_5_WEAPON1_AMMO 400
- #define LVL_5_WEAPON2 15
- #define LVL_5_WEAPON2_AMMO 1
- #define LVL_5_WEAPON3 0
- #define LVL_5_WEAPON3_AMMO 0
- #define LVL_5_HEALTH 100
- #define LVL_5_ARMOR 100
- //-
- #define LVL_6_WEAPON1 29
- #define LVL_6_WEAPON1_AMMO 1000
- #define LVL_6_WEAPON2 5
- #define LVL_6_WEAPON2_AMMO 1
- #define LVL_6_WEAPON3 0
- #define LVL_6_WEAPON3_AMMO 0
- #define LVL_6_HEALTH 100
- #define LVL_6_ARMOR 100
- //-
- #define LVL_7_WEAPON1 27
- #define LVL_7_WEAPON1_AMMO 1000
- #define LVL_7_WEAPON2 0
- #define LVL_7_WEAPON2_AMMO 1000
- #define LVL_7_WEAPON3 33
- #define LVL_7_WEAPON3_AMMO 100
- #define LVL_7_HEALTH 100
- #define LVL_7_ARMOR 100
- //-
- #define LVL_8_WEAPON1 0
- #define LVL_8_WEAPON1_AMMO 500
- #define LVL_8_WEAPON2 34
- #define LVL_8_WEAPON2_AMMO 500
- #define LVL_8_WEAPON3 0
- #define LVL_8_WEAPON3_AMMO 34
- #define LVL_8_HEALTH 100
- #define LVL_8_ARMOR 100
- //-
- #define LVL_9_WEAPON1 30
- #define LVL_9_WEAPON1_AMMO 1000
- #define LVL_9_WEAPON2 0
- #define LVL_9_WEAPON2_AMMO 500
- #define LVL_9_WEAPON3 16
- #define LVL_9_WEAPON3_AMMO 100
- #define LVL_9_HEALTH 100
- #define LVL_9_ARMOR 100
- //-
- #define LVL_10_WEAPON1 16
- #define LVL_10_WEAPON1_AMMO 10
- #define LVL_10_WEAPON2 9
- #define LVL_10_WEAPON2_AMMO 50
- #define LVL_10_WEAPON3 31
- #define LVL_10_WEAPON3_AMMO 50000
- #define LVL_10_HEALTH 100
- #define LVL_10_ARMOR 100
- new Text:Textdraw[MAX_PLAYERS];
- new Text:Textdraw2[MAX_PLAYERS];
- new Text3D:label[MAX_PLAYERS];
- new Text3D:label2[MAX_PLAYERS];
- new Text3D:label3[MAX_PLAYERS];
- new Text3D:label4[MAX_PLAYERS];
- new Text3D:label5[MAX_PLAYERS];
- new Text3D:label6[MAX_PLAYERS];
- new Text3D:label7[MAX_PLAYERS];
- new Text3D:label8[MAX_PLAYERS];
- new Text3D:label9[MAX_PLAYERS];
- new Text3D:label10[MAX_PLAYERS];
- //===============================================================================================
- public OnFilterScriptInit()
- {
- print("\n----------------------------------");
- print(" Bboy's Level script ");
- print("----------------------------------\n");
- SetTimer("level",500,true);//Change this if you want the level check to be longer or shorter!
- if(!dini_Exists("Levels.cfg"))
- {
- dini_Create("Levels.cfg");
- }
- if(!dini_Exists("Kills.cfg"))
- {
- dini_Create("Kills.cfg");
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- #if defined LVL_SAVE
- new Pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Pname, sizeof(Pname));
- LVL[playerid] = dini_Int("Levels.cfg", Pname);
- Kills[playerid] = dini_Int("Kills.cfg", Pname);
- #endif
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- #if defined LVL_SAVE
- new Pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Pname, sizeof(Pname));
- dini_IntSet("Levels.cfg", Pname, LVL[playerid]);
- dini_IntSet("Kills.cfg", Pname, Kills[playerid]);
- #endif
- return 1;
- }
- #if defined LVL_WEPONS
- public OnPlayerSpawn(playerid)
- {
- //-------Weapons, health and armour
- if (LVL[playerid]==1)
- {
- GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
- SetPlayerHealth(playerid,LVL_1_HEALTH);
- SetPlayerArmour(playerid,LVL_1_ARMOR);
- GivePlayerMoney(playerid,4);
- SetPlayerScore(playerid,1);
- TextDrawShowForPlayer(playerid, Textdraw[playerid]);
- }
- if (LVL[playerid]==2)
- {
- GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
- SetPlayerHealth(playerid,LVL_2_HEALTH);
- SetPlayerArmour(playerid,LVL_2_ARMOR);
- SetPlayerMoney(playerid,4);
- SetPlayerScore(playerid,2);
- TextDrawShowForPlayer(playerid, Textdraw2[playerid]);
- }
- if (LVL[playerid]==3)
- {
- GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
- SetPlayerHealth(playerid,LVL_3_HEALTH);
- SetPlayerArmour(playerid,LVL_3_ARMOR);
- SetPlayerMoney(playerid,4);
- SetPlayerScore(playerid,3);
- }
- if (LVL[playerid]==4)
- {
- GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
- SetPlayerHealth(playerid,LVL_4_HEALTH);
- SetPlayerArmour(playerid,LVL_4_ARMOR);
- SetPlayerMoney(playerid,4);
- SetPlayerScore(playerid,4);
- }
- if (LVL[playerid]==5)
- {
- GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON1,LVL_5_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON2,LVL_5_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON3,LVL_5_WEAPON3_AMMO);
- SetPlayerHealth(playerid,LVL_5_HEALTH);
- SetPlayerArmour(playerid,LVL_5_ARMOR);
- SetPlayerMoney(playerid,4);
- SetPlayerScore(playerid,5);
- }
- if (LVL[playerid]==6)
- {
- GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON1,LVL_5_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON2,LVL_5_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON3,LVL_5_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON1,LVL_6_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON2,LVL_6_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON3,LVL_6_WEAPON3_AMMO);
- SetPlayerHealth(playerid,LVL_6_HEALTH);
- SetPlayerArmour(playerid,LVL_6_ARMOR);
- SetPlayerMoney(playerid,4);
- SetPlayerScore(playerid,6);
- }
- if (LVL[playerid]==7)
- {
- GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON1,LVL_5_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON2,LVL_5_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON3,LVL_5_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON1,LVL_6_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON2,LVL_6_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON3,LVL_6_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_7_WEAPON1,LVL_7_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_7_WEAPON2,LVL_7_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_7_WEAPON3,LVL_7_WEAPON3_AMMO);
- SetPlayerHealth(playerid,LVL_7_HEALTH);
- SetPlayerArmour(playerid,LVL_7_ARMOR);
- SetPlayerMoney(playerid,4);
- SetPlayerScore(playerid,7);
- }
- if (LVL[playerid]==8)
- {
- GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON1,LVL_5_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON2,LVL_5_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON3,LVL_5_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON1,LVL_6_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON2,LVL_6_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON3,LVL_6_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_7_WEAPON1,LVL_7_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_7_WEAPON2,LVL_7_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_7_WEAPON3,LVL_7_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_8_WEAPON1,LVL_8_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_8_WEAPON2,LVL_8_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_8_WEAPON3,LVL_8_WEAPON3_AMMO);
- SetPlayerHealth(playerid,LVL_8_HEALTH);
- SetPlayerArmour(playerid,LVL_8_ARMOR);
- GivePlayerMoney(playerid,4);
- SetPlayerScore(playerid,8);
- }
- if (LVL[playerid]==9)
- {
- GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON1,LVL_5_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON2,LVL_5_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON3,LVL_5_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON1,LVL_6_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON2,LVL_6_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON3,LVL_6_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_7_WEAPON1,LVL_7_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_7_WEAPON2,LVL_7_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_7_WEAPON3,LVL_7_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_8_WEAPON1,LVL_8_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_8_WEAPON2,LVL_8_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_8_WEAPON3,LVL_8_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_9_WEAPON1,LVL_9_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_9_WEAPON2,LVL_9_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_9_WEAPON3,LVL_9_WEAPON3_AMMO);
- SetPlayerHealth(playerid,LVL_9_HEALTH);
- SetPlayerArmour(playerid,LVL_9_ARMOR);
- SetPlayerMoney(playerid,4);
- SetPlayerScore(playerid,9);
- }
- if (LVL[playerid]==10)
- {
- GivePlayerWeapon(playerid,LVL_1_WEAPON1,LVL_1_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON2,LVL_1_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_1_WEAPON3,LVL_1_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON1,LVL_2_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON2,LVL_2_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_2_WEAPON3,LVL_2_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON1,LVL_3_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON2,LVL_3_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_3_WEAPON3,LVL_3_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON1,LVL_4_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON2,LVL_4_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_4_WEAPON3,LVL_4_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON1,LVL_5_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON2,LVL_5_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_5_WEAPON3,LVL_5_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON1,LVL_6_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON2,LVL_6_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_6_WEAPON3,LVL_6_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_7_WEAPON1,LVL_7_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_7_WEAPON2,LVL_7_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_7_WEAPON3,LVL_7_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_8_WEAPON1,LVL_8_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_8_WEAPON2,LVL_8_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_8_WEAPON3,LVL_8_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_9_WEAPON1,LVL_9_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_9_WEAPON2,LVL_9_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_9_WEAPON3,LVL_9_WEAPON3_AMMO);
- GivePlayerWeapon(playerid,LVL_10_WEAPON1,LVL_10_WEAPON1_AMMO);
- GivePlayerWeapon(playerid,LVL_10_WEAPON2,LVL_10_WEAPON2_AMMO);
- GivePlayerWeapon(playerid,LVL_10_WEAPON3,LVL_10_WEAPON3_AMMO);
- SetPlayerHealth(playerid,LVL_10_HEALTH);
- SetPlayerArmour(playerid,LVL_10_ARMOR);
- SetPlayerMoney(playerid,2);
- SetPlayerScore(playerid,10);
- }
- return 1;
- }
- #endif
- forward level();
- public level()
- {
- for(new i=0; i < MAX_PLAYERS; i++)
- {
- if(GetPlayerKills(i) >= LVL_1 && LVL[i] == 0)
- {
- SendClientMessage(i,LVL_MESSAGE_COLOR,"type /level=see youre level type /levels for see the levels score");
- LVL[i] = 1;
- }
- if(GetPlayerKills(i) >= LVL_2 && LVL[i] == 1)
- {
- SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 2!");
- LVL[i] = 2;
- GameTextForPlayer(i,"~w~Level Up",5000,3);
- DeletePlayer3DTextLabel(i, label[i]);
- label2[i] = Create3DTextLabel("Level:2",0x38FF06FF,30.0,40.0,50.0,40.0,0);
- Attach3DTextLabelToPlayer(label2[i], i, 0.0, 0.0, 0.7);
- }
- if(GetPlayerKills(i) >= LVL_3 && LVL[i] == 2)
- {
- SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 3!");
- LVL[i] = 3;
- GameTextForPlayer(i,"~w~Level Up",5000,3);
- }
- if(GetPlayerKills(i) >= LVL_4 && LVL[i] == 3)
- {
- SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 4!");
- LVL[i] = 4;
- GameTextForPlayer(i,"~w~Level Up",5000,3);
- }
- if(GetPlayerKills(i) >= LVL_5 && LVL[i] == 4)
- {
- SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 5!");
- LVL[i] = 5;
- GameTextForPlayer(i,"~w~Level Up",5000,3);
- }
- if(GetPlayerKills(i) >= LVL_6 && LVL[i] == 5)
- {
- SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 6!");
- LVL[i] = 6;
- GameTextForPlayer(i,"~w~Level Up",5000,3);
- }
- if(GetPlayerKills(i) >= LVL_7 && LVL[i] == 6)
- {
- SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 7!");
- LVL[i] = 7;
- GameTextForPlayer(i,"~w~Level Up",5000,3);
- }
- if(GetPlayerKills(i) >= LVL_8 && LVL[i] == 7)
- {
- SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 8!");
- LVL[i] = 8;
- GameTextForPlayer(i,"~w~Level Up",5000,3);
- }
- if(GetPlayerKills(i) >= LVL_9&& LVL[i] == 8)
- {
- SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 9!");
- LVL[i] = 9;
- GameTextForPlayer(i,"~w~Level Up",5000,3);
- }
- if(GetPlayerKills(i) >= LVL_10 && LVL[i] == 9)
- {
- SendClientMessage(i,LVL_MESSAGE_COLOR,"You are now level 10!");
- LVL[i] = 10;
- GameTextForPlayer(i,"~w~Level Up",5000,3);
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid,killerid,reason)
- {
- if(killerid != INVALID_PLAYER_ID)
- {
- Kills[killerid]++;
- Kills[killerid]++;
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/Levels", cmdtext, true, 10) == 0)
- {
- new string1[512],string2[512];
- format(string1, sizeof (string1), "Level 2: %d \r\n Level 3: %d \r\n Level 4: %d \r\n Level 5: %d \r\n ",LVL_2,LVL_3,LVL_4,LVL_5);
- format(string2, sizeof (string2), "Level 6: %d \r\n Level 7: %d \r\n Level 8: %d \r\n Level 9: %d \r\n Level 10: %d \r\n",LVL_6,LVL_7,LVL_8,LVL_9,LVL_10);
- SendClientMessage(playerid,0xFF0000AA,"Levels:");
- SendClientMessage(playerid,0xF4FFFFFF,string1);
- SendClientMessage(playerid,0xF4FFFFFF,string2);
- SendClientMessage(playerid,0xF414FFFF,"Your level will be saved when you leave!");
- return 1;
- }
- //------DCMD Commands
- dcmd(level, 5, cmdtext);
- dcmd(Kills, 5, cmdtext);
- dcmd(LevelSet, 8, cmdtext);
- return 0;
- }
- dcmd_level(playerid, params[])
- {
- new id, pname[24] ,string[256];
- if (sscanf(params, "d", id))
- return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/Level <playerid>\"");
- else if (!IsPlayerConnected(id))
- return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
- else
- {
- GetPlayerName(id,pname,24);
- format(string, sizeof (string), "%s is level %d",pname,LVL[id]);
- SendClientMessage(playerid,0x0660FF,string);
- }
- return 1;
- }
- dcmd_Kills(playerid, params[])
- {
- new id, pname[24] ,string[256];
- if (sscanf(params, "d", id))
- return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/Kills <playerid>\"");
- else if (!IsPlayerConnected(id))
- return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
- else
- {
- GetPlayerName(id,pname,MAX_PLAYER_NAME);
- format(string,sizeof(string),"%s has %d kills",pname,Kills[id]);
- SendClientMessage(playerid,0x0660FF,string);
- }
- return 1;
- }
- dcmd_LevelSet(playerid, params[])
- {
- new id,LVL2 ,string[256],name[24];
- GetPlayerName(playerid,name,24);
- if (sscanf(params, "d,i", id,LVL2))
- return SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/LevelSet <playerid> <level>\"");
- else if (!IsPlayerConnected(id))
- return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
- else if (!IsPlayerAdmin(playerid))
- return SendClientMessage(playerid, 0xFF0000AA, "You are not admin");
- else if (LVL2>10&&LVL2<0)
- return SendClientMessage(playerid, 0xFF0000AA, "Levels are between 0-10!");
- else if (LVL2==0)
- {
- LVL[id] =0;
- format(string, sizeof (string), "%s has set you to level 0",name);
- SetPlayerScore(id,0);
- SendClientMessage(id,0x0660FF,string);
- Kills[id]=0;
- }
- else if (LVL2==1)
- {
- LVL[id] =1;
- format(string, sizeof (string), "%s has set you to level 1",name);
- SendClientMessage(id,0x0660FF,string);
- Kills[id]=LVL_1;
- }
- else if (LVL2==2)
- {
- LVL[id] =2;
- format(string, sizeof (string), "%s has set you to level 2",name);
- SendClientMessage(id,0x0660FF,string);
- Kills[id]=LVL_2;
- TextDrawDestroy(Textdraw[playerid]);
- }
- else if (LVL2==3){
- LVL[id] =3;
- format(string, sizeof (string), "%s has set you to level 3",name);
- SendClientMessage(id,0x0660FF,string);
- Kills[id]=LVL_3;
- }
- else if (LVL2==4)
- {
- LVL[id] =4;
- format(string, sizeof (string), "%s has set you to level 4",name);
- SendClientMessage(id,0x0660FF,string);
- Kills[id]=LVL_4;
- }
- else if (LVL2==5)
- {
- LVL[id] =5;
- format(string, sizeof (string), "%s has set you to level 5",name);
- SendClientMessage(id,0x0660FF,string);
- Kills[id]=LVL_5;
- }
- else if (LVL2==6)
- {
- LVL[id] =6;
- format(string, sizeof (string), "%s has set you to level 6",name);
- SendClientMessage(id,0x0660FF,string);
- Kills[id]=LVL_6;
- }
- else if (LVL2==7)
- {
- LVL[id] =7;
- format(string, sizeof (string), "%s has set you to level 7",name);
- SendClientMessage(id,0x0660FF,string);
- Kills[id]=LVL_7;
- }
- else if (LVL2==8)
- {
- LVL[id] =8;
- format(string, sizeof (string), "%s has set you to level 8",name);
- SendClientMessage(id,0x0660FF,string);
- Kills[id]=LVL_8;
- }
- else if (LVL2==9)
- {
- LVL[id] =9;
- format(string, sizeof (string), "%s has set you to level 9",name);
- SendClientMessage(id,0x0660FF,string);
- Kills[id]=LVL_9;
- }
- else if (LVL2==10){
- LVL[id] =10;
- format(string, sizeof (string), "%s has set you to level 10",name);
- SendClientMessage(id,0x0660FF,string);
- Kills[id]=LVL_10;
- }
- return 1;
- }
- stock GetPlayerKills(playerid)
- {
- return Kills[playerid];
- }
- //----------------------------------------------Sccanaf---------------------------------------------------
- stock sscanf(string[], format[], {Float,_}:...)
- {
- new
- formatPos = 0,
- stringPos = 0,
- paramPos = 2,
- paramCount = numargs();
- while (paramPos < paramCount && string[stringPos])
- {
- switch (format[formatPos++])
- {
- case '\0':
- {
- return 0;
- }
- case 'i', 'd':
- {
- new
- neg = 1,
- num = 0,
- ch = string[stringPos];
- if (ch == '-')
- {
- neg = -1;
- ch = string[++stringPos];
- }
- do
- {
- stringPos++;
- if (ch >= '0' && ch <= '9')
- {
- num = (num * 10) + (ch - '0');
- }
- else
- {
- return 1;
- }
- }
- while ((ch = string[stringPos]) && ch != ' ');
- setarg(paramPos, 0, num * neg);
- }
- case 'h', 'x':
- {
- new
- ch,
- num = 0;
- while ((ch = string[stringPos++]))
- {
- switch (ch)
- {
- case 'x', 'X':
- {
- num = 0;
- continue;
- }
- case '0' .. '9':
- {
- num = (num << 4) | (ch - '0');
- }
- case 'a' .. 'f':
- {
- num = (num << 4) | (ch - ('a' - 10));
- }
- case 'A' .. 'F':
- {
- num = (num << 4) | (ch - ('A' - 10));
- }
- case ' ':
- {
- break;
- }
- default:
- {
- return 1;
- }
- }
- }
- setarg(paramPos, 0, num);
- }
- case 'c':
- {
- setarg(paramPos, 0, string[stringPos++]);
- }
- case 'f':
- {
- new tmp[25];
- strmid(tmp, string, stringPos, stringPos+sizeof(tmp)-2);
- setarg(paramPos, 0, _:floatstr(tmp));
- }
- case 's', 'z':
- {
- new
- i = 0,
- ch;
- if (format[formatPos])
- {
- while ((ch = string[stringPos++]) && ch != ' ')
- {
- setarg(paramPos, i++, ch);
- }
- if (!i) return 1;
- }
- else
- {
- while ((ch = string[stringPos++]))
- {
- setarg(paramPos, i++, ch);
- }
- }
- stringPos--;
- setarg(paramPos, i, '\0');
- }
- default:
- {
- continue;
- }
- }
- while (string[stringPos] && string[stringPos] != ' ')
- {
- stringPos++;
- }
- while (string[stringPos] == ' ')
- {
- stringPos++;
- }
- paramPos++;
- }
- while (format[formatPos] == 'z') formatPos++;
- return format[formatPos];
- }
- //-----------------------------END-------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment