NewbieTesterBeta

TDM NClass System

Aug 14th, 2014
694
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 19.71 KB | None | 0 0
  1. /* -----------------------------------------------------------------------------
  2. - Simple TDM Class System by NewbieTester
  3. - Release of First Version
  4.  Version 1 :
  5.  =======[ 7 Different Classes ]=======
  6.  Assault
  7.  Sniper
  8.  Medic
  9.  Engineer
  10.  Airforce
  11.  Spy
  12.  Special Forces
  13.  =====================================
  14.  If you Find bugs or Anything,Just PM me at [email protected] or visit my FB page at https://www.facebook.com/ntsamp
  15.  */
  16.  
  17. #define FILTERSCRIPT
  18.  
  19. #include <a_samp>
  20. #include <sscanf2>
  21.  
  22. #if defined FILTERSCRIPT
  23.  
  24. // Classes
  25. #define ASSAULT 1
  26. #define SNIPER 2
  27. #define MEDIC 3
  28. #define ENGINEER 4
  29. #define AIRFORCE 5
  30. #define SPY 6
  31. #define SPECIAL_FORCE 7
  32.  
  33. // Colors
  34. #define COLOR_WHITE 0xFFFFFFFF
  35. #define COL_GREEN          "{6EF83C}"
  36. #define COL_WHITE          "{FFFFFF}"
  37. #define COLOR_RED          0xAA3333AA
  38. #define COLOR_GREEN        0x33AA33AA
  39.  
  40. // Class Variables
  41. new gPlayerClass[MAX_PLAYERS];
  42. new PickedClass[MAX_PLAYERS];
  43.  
  44. public OnFilterScriptInit()
  45. {
  46.     print("\n--------------------------------------");
  47.     print(" TDM Class System by NewbieTester");
  48.     print("--------------------------------------\n");
  49.     return 1;
  50. }
  51.  
  52. public OnFilterScriptExit()
  53. {
  54.     return 1;
  55. }
  56.  
  57. #else
  58.  
  59. main()
  60. {
  61.     print("\n----------------------------------");
  62.     print(" Blank Gamemode by your name here");
  63.     print("----------------------------------\n");
  64. }
  65.  
  66. #endif
  67.  
  68. public OnGameModeInit()
  69. {
  70.     // Don't use these lines if it's a filterscript
  71.     SetGameModeText("Blank Script");
  72.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  73.     return 1;
  74. }
  75.  
  76. public OnGameModeExit()
  77. {
  78.     return 1;
  79. }
  80.  
  81. public OnPlayerRequestClass(playerid, classid)
  82. {
  83.     ShowPlayerDialog(playerid, 999, DIALOG_STYLE_LIST, "{6EF83C}Choose A Class:", "Assault Class\nSniper Class\nMedic Class\nEngineer Class\nAirforce Class\nSpy Class\nSpecial Forces Class", "Choose","");
  84.     return 1;
  85. }
  86.  
  87. public OnPlayerConnect(playerid)
  88. {
  89.     return 1;
  90. }
  91.  
  92. public OnPlayerDisconnect(playerid, reason)
  93. {
  94.     return 1;
  95. }
  96.  
  97. public OnPlayerSpawn(playerid)
  98. {
  99.     if(gPlayerClass[playerid] == ASSAULT)// Assault Class
  100.     {
  101.         TogglePlayerControllable(playerid, 1);
  102.         ResetPlayerWeapons(playerid);
  103.         GivePlayerWeapon(playerid, 31, 200);//m4
  104.         GivePlayerWeapon(playerid, 25, 100);//mp5
  105.         GivePlayerWeapon(playerid, 24, 70);//deagle
  106.     }
  107.     else if(gPlayerClass[playerid] == SNIPER)//This is for the Second Sniper class.
  108.     {
  109.         TogglePlayerControllable(playerid, 1);
  110.         ResetPlayerWeapons(playerid);
  111.         GivePlayerWeapon(playerid, 34, 250);//sniper
  112.         GivePlayerWeapon(playerid, 29, 250);//mp5
  113.         GivePlayerWeapon(playerid, 4, 1);//knife
  114.     }
  115.     else if(gPlayerClass[playerid] == MEDIC)//This is for the Second Medic class.
  116.     {
  117.         TogglePlayerControllable(playerid, 1);
  118.         ResetPlayerWeapons(playerid);
  119.         GivePlayerWeapon(playerid, 25, 200);//shotgun
  120.         GivePlayerWeapon(playerid, 23, 200);//silent pistol
  121.         GivePlayerWeapon(playerid, 29, 150);//mp5
  122.     }
  123.     else if(gPlayerClass[playerid] == ENGINEER)//This is for the Second Engineer class.
  124.     {
  125.         TogglePlayerControllable(playerid, 1);
  126.         ResetPlayerWeapons(playerid);
  127.         GivePlayerWeapon(playerid, 27, 70);//SPAS-12
  128.         GivePlayerWeapon(playerid, 24, 30);//Deagle
  129.         GivePlayerWeapon(playerid, 35, 2);//rpg
  130.         GivePlayerWeapon(playerid, 16, 3);//Grenades
  131.     }
  132.     else if(gPlayerClass[playerid] ==AIRFORCE)//This is for the Second Airforce class.
  133.     {
  134.         TogglePlayerControllable(playerid, 1);
  135.         ResetPlayerWeapons(playerid);
  136.         GivePlayerWeapon(playerid, 24, 200);//deagle
  137.         GivePlayerWeapon(playerid, 17, 4);//moltove
  138.         GivePlayerWeapon(playerid, 25, 100);//shotgun
  139.     }
  140.     else if(gPlayerClass[playerid] == SPY)//This is for the Second Spy class.
  141.     {
  142.         TogglePlayerControllable(playerid, 1);
  143.         ResetPlayerWeapons(playerid);
  144.         GivePlayerWeapon(playerid, 29, 200);//mp5
  145.         GivePlayerWeapon(playerid, 23, 200);//silent pistol
  146.         GivePlayerWeapon(playerid, 31, 200);//m4
  147.         GivePlayerWeapon(playerid, 24, 200);//deagle
  148.     }
  149.     else if(gPlayerClass[playerid] == SPECIAL_FORCE)//This is for the Second Special Forces class.
  150.     {
  151.         TogglePlayerControllable(playerid, 1);
  152.         ResetPlayerWeapons(playerid);
  153.         GivePlayerWeapon(playerid, 29, 200);//mp5
  154.         GivePlayerWeapon(playerid, 27, 70);//SPAS-12
  155.         GivePlayerWeapon(playerid, 31, 200);//m4
  156.         GivePlayerWeapon(playerid, 24, 200);//deagle
  157.     }
  158.     return 1;
  159. }
  160.  
  161. public OnPlayerDeath(playerid, killerid, reason)
  162. {
  163.     return 1;
  164. }
  165.  
  166. public OnVehicleSpawn(vehicleid)
  167. {
  168.     return 1;
  169. }
  170.  
  171. public OnVehicleDeath(vehicleid, killerid)
  172. {
  173.     return 1;
  174. }
  175.  
  176. public OnPlayerText(playerid, text[])
  177. {
  178.     return 1;
  179. }
  180.  
  181. public OnPlayerCommandText(playerid, cmdtext[])
  182. {
  183.     if(!strcmp(cmdtext, "/jetpack", true))//jetpack spawn command
  184.         {
  185.  
  186.         if(gPlayerClass[playerid] == AIRFORCE)//if the player is Airforce
  187.         {
  188.              SetPlayerSpecialAction(playerid,2);//This is command for the Airforce, he  can spawn jetpack by /jp command
  189.              return 1;
  190.         }
  191.     }
  192.  
  193.     if (!strcmp(cmdtext, "/heal", true))
  194.          {
  195.          
  196.          if(gPlayerClass[playerid] == MEDIC)//if the player is Medic
  197.          {
  198.                SetPlayerHealth(playerid, 100.0);
  199.                SendClientMessage(playerid, 0x00FF00AA, "Player healed.");
  200.                SendClientMessage(playerid, COLOR_RED, "You may heal again in 15 seconds.");
  201.                SetTimerEx("HealAgain", 15000, 0, "i", playerid);
  202.          }
  203.          else SendClientMessage(playerid,-1,"COLOR_WHITE "" You have to be in a Medic Class to use this Command");
  204.     }
  205.    
  206.     if(!strcmp(cmdtext, "/disguise", true))//dialog which tells u about the spy class disguises
  207.         {
  208.  
  209.         if(gPlayerClass[playerid] == SPY)
  210.         {
  211.              ShowPlayerDialog(playerid, 88, DIALOG_STYLE_MSGBOX, "{6EF83C}Spy Disguise  Kit:", "/team1\n/team2\n/team3", "Disguise ","Exit");//Replace the team1,2,3 to your game teams name and colors, by /team1 or /team2 or / team3 the player gets disguise to enemy soldier but don't changes its team
  212.              return 1;
  213.         }
  214.     }
  215.  
  216.     if(!strcmp(cmdtext, "/team1", true))//This is for disguise to team 1
  217.         {
  218.  
  219.         if(gPlayerClass[playerid] == SPY)//if player class spy
  220.         {
  221.              ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Disguised to Team1:", "Team: Team1\nColor: Red\nSkin: 285\nDisguised Class: Soldier", "Ok ","");
  222.              SetPlayerSkin(playerid,285);
  223.              SetPlayerColor(playerid,COLOR_RED);
  224.              return 1;
  225.         }
  226.     }
  227.     if(!strcmp(cmdtext, "/team2", true))//This is for disguise to team 2
  228.         {
  229.  
  230.         if(gPlayerClass[playerid] == SPY)//if player class spy
  231.         {
  232.              ShowPlayerDialog(playerid, 22, DIALOG_STYLE_MSGBOX, "{6EF83C}Disguised to Team2:", "Team: Team2\nColor: White\nSkin: 287\nDisguised Class: Soldier", "Ok ","");
  233.              SetPlayerSkin(playerid,287);
  234.              SetPlayerColor(playerid,COLOR_WHITE);
  235.              return 1;
  236.         }
  237.     }
  238.  
  239.     if(!strcmp(cmdtext, "/team3", true))//This is for disguise to team 1
  240.         {
  241.  
  242.         if(gPlayerClass[playerid] == SPY)//if player class spy
  243.         {
  244.              ShowPlayerDialog(playerid, 33, DIALOG_STYLE_MSGBOX, "{6EF83C}Disguised to Team3:", "Team: Team3\nColor: Green\nSkin: 181\nDisguised Class: Soldier", "Ok ","");
  245.              SetPlayerSkin(playerid,181);
  246.              SetPlayerColor(playerid,COLOR_GREEN);
  247.              return 1;
  248.         }
  249.     }
  250.     return 0;
  251. }
  252.  
  253. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  254. {
  255.     return 1;
  256. }
  257.  
  258. public OnPlayerExitVehicle(playerid, vehicleid)
  259. {
  260.     return 1;
  261. }
  262.  
  263. public OnPlayerStateChange(playerid, newstate, oldstate)
  264. {
  265.     new vehicleid = GetPlayerVehicleID(playerid);//variable to get vehicle ids
  266.     if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == ASSAULT && gPlayerClass[playerid] == SNIPER && gPlayerClass[playerid] == MEDIC && gPlayerClass[playerid] == ENGINEER && gPlayerClass[playerid] == SPY && gPlayerClass[playerid] == SPECIAL_FORCE)//if player is pilot then he can drive
  267.     {
  268.         SendClientMessage(playerid, COLOR_RED, "You Need to  be an Airforce to fly Hunter");//messages goes to the player that he can't drive the hunter
  269.         RemovePlayerFromVehicle(playerid);//get u off from the hunter
  270.     }
  271.  
  272.     if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == ASSAULT && gPlayerClass[playerid] == SNIPER && gPlayerClass[playerid] == MEDIC && gPlayerClass[playerid] == ENGINEER && gPlayerClass[playerid] == SPY && gPlayerClass[playerid] == SPECIAL_FORCE)//if player is pilot then he can drive
  273.     {
  274.         SendClientMessage(playerid, COLOR_RED, "You Need to  be an Airforce to fly Hydra");//messages goes to the player that he can't drive the hydra
  275.         RemovePlayerFromVehicle(playerid);//get u off from the hydra
  276.     }
  277.  
  278.     if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == ASSAULT && gPlayerClass[playerid] == SNIPER && gPlayerClass[playerid] == MEDIC && gPlayerClass[playerid] == AIRFORCE && gPlayerClass[playerid] == SPY && gPlayerClass[playerid] == SPECIAL_FORCE)//if player is Soldier then he can drive
  279.     {
  280.         SendClientMessage(playerid, COLOR_RED, "You Need to  be an Engineer to drive Tank");//messages goes to the player that he can't drive the tank or rhino
  281.         RemovePlayerFromVehicle(playerid);//get u off from the tank or rhino
  282.     }
  283.  
  284.     if(GetVehicleModel(vehicleid) == 425 && gPlayerClass[playerid] == ASSAULT && gPlayerClass[playerid] == SNIPER && gPlayerClass[playerid] == MEDIC && gPlayerClass[playerid] == ENGINEER && gPlayerClass[playerid] == SPY && gPlayerClass[playerid] == SPECIAL_FORCE)//if player is pilot then he can drive
  285.     {
  286.         SendClientMessage(playerid, COLOR_RED, "You Need to  be an Airforce to fly Sea Sparrow");
  287.         RemovePlayerFromVehicle(playerid);//get u off from the sea sparrow
  288.     }
  289.     return 1;
  290. }
  291.  
  292. public OnPlayerEnterCheckpoint(playerid)
  293. {
  294.     return 1;
  295. }
  296.  
  297. public OnPlayerLeaveCheckpoint(playerid)
  298. {
  299.     return 1;
  300. }
  301.  
  302. public OnPlayerEnterRaceCheckpoint(playerid)
  303. {
  304.     return 1;
  305. }
  306.  
  307. public OnPlayerLeaveRaceCheckpoint(playerid)
  308. {
  309.     return 1;
  310. }
  311.  
  312. public OnRconCommand(cmd[])
  313. {
  314.     return 1;
  315. }
  316.  
  317. public OnPlayerRequestSpawn(playerid)
  318. {
  319.     return 1;
  320. }
  321.  
  322. public OnObjectMoved(objectid)
  323. {
  324.     return 1;
  325. }
  326.  
  327. public OnPlayerObjectMoved(playerid, objectid)
  328. {
  329.     return 1;
  330. }
  331.  
  332. public OnPlayerPickUpPickup(playerid, pickupid)
  333. {
  334.     return 1;
  335. }
  336.  
  337. public OnVehicleMod(playerid, vehicleid, componentid)
  338. {
  339.     return 1;
  340. }
  341.  
  342. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  343. {
  344.     return 1;
  345. }
  346.  
  347. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  348. {
  349.     return 1;
  350. }
  351.  
  352. public OnPlayerSelectedMenuRow(playerid, row)
  353. {
  354.     return 1;
  355. }
  356.  
  357. public OnPlayerExitedMenu(playerid)
  358. {
  359.     return 1;
  360. }
  361.  
  362. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  363. {
  364.     return 1;
  365. }
  366.  
  367. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  368. {
  369.     return 1;
  370. }
  371.  
  372. public OnRconLoginAttempt(ip[], password[], success)
  373. {
  374.     return 1;
  375. }
  376.  
  377. public OnPlayerUpdate(playerid)
  378. {
  379.     return 1;
  380. }
  381.  
  382. public OnPlayerStreamIn(playerid, forplayerid)
  383. {
  384.     return 1;
  385. }
  386.  
  387. public OnPlayerStreamOut(playerid, forplayerid)
  388. {
  389.     return 1;
  390. }
  391.  
  392. public OnVehicleStreamIn(vehicleid, forplayerid)
  393. {
  394.     return 1;
  395. }
  396.  
  397. public OnVehicleStreamOut(vehicleid, forplayerid)
  398. {
  399.     return 1;
  400. }
  401.  
  402. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  403. {
  404.     if(dialogid == 999)//dialog id response
  405.     {
  406.         if(response)
  407.         {
  408.             if(listitem == 0)//the listitem0, defines the number one option of the dialog
  409.             {
  410.                 if(GetPlayerScore(playerid) >= 0)//if player have 0 score then  he can choose this class
  411.                 {
  412.                     SendClientMessage(playerid, COLOR_WHITE, "You chose the Assault as your class.");
  413.                     ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Assault Class:", "{F81414}Abilities:\n{FFFFFF}A Solo class, good in infantry attacks.\n\n{F81414}Weapons:\n\n{FFFFFF}M4\n{FFFFFF}Shotgun\n{FFFFFF}Deagle", "Play","");
  414.                     gPlayerClass[playerid] = ASSAULT;//setting the class to soldier
  415.                     PickedClass[playerid] = 1;
  416.                     SetPlayerVirtualWorld(playerid, 0);
  417.                     TogglePlayerControllable(playerid, 1);
  418.                     ResetPlayerWeapons(playerid);
  419.                     GivePlayerWeapon(playerid, 31, 200);//m4
  420.                     GivePlayerWeapon(playerid, 25, 100);//mp5
  421.                     GivePlayerWeapon(playerid, 24, 70);//deagle
  422.                 }
  423.             }
  424.  
  425.             if(listitem == 1)//the listitem1, defines the number one option of the dialog
  426.             {
  427.                 if(GetPlayerScore(playerid) >= 100)//if player have 100 score then  he can choose this class
  428.                 {
  429.                     SendClientMessage(playerid, COLOR_WHITE, "You chose the Sniper as your class.");
  430.                     ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Sniper Class:", "{F81414}Abilities:\n{FFFFFF}A Locater class, Always invisible on map.\n\n{F81414}Weapons:\n\n{FFFFFF}Sniper Rifle\n{FFFFFF}Mp5\n{FFFFFF}Knife", "Play","");
  431.                     gPlayerClass[playerid] = SNIPER;//setting the class to Sniper
  432.                     PickedClass[playerid] = 1;
  433.                     RemovePlayerMapIcon(playerid, 0);
  434.                     SetPlayerVirtualWorld(playerid, 0);
  435.                     TogglePlayerControllable(playerid, 1);
  436.                     ResetPlayerWeapons(playerid);
  437.                     GivePlayerWeapon(playerid, 34, 250);//sniper
  438.                     GivePlayerWeapon(playerid, 29, 250);//mp5
  439.                     GivePlayerWeapon(playerid, 4, 1);//knife
  440.                 }
  441.             }
  442.  
  443.             if(listitem == 2)//the listitem2, defines the number one option of the dialog
  444.             {
  445.                 if(GetPlayerScore(playerid) >= 500)//if player have 500 score then  he can choose this class
  446.                 {
  447.                     SendClientMessage(playerid, COLOR_WHITE, "You chose the Medic as your class.");
  448.                     ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Medic Class:", "{F81414}Abilities:\n{FFFFFF}A Helper Class\nCan Heal TeamMates.\n\n{F81414}Weapons:\n\n{FFFFFF}Shotgun\n{FFFFFF}Silent Pistol\n{FFFFFF}mp5", "Play","");
  449.                     gPlayerClass[playerid] = MEDIC;//setting the class to medic
  450.                     PickedClass[playerid] = 1;
  451.                     SetPlayerVirtualWorld(playerid, 0);
  452.                     TogglePlayerControllable(playerid, 1);
  453.                     ResetPlayerWeapons(playerid);
  454.                     GivePlayerWeapon(playerid, 25, 200);//shotgun
  455.                     GivePlayerWeapon(playerid, 23, 200);//silent pistol
  456.                     GivePlayerWeapon(playerid, 29, 150);//mp5
  457.                 }
  458.             }
  459.  
  460.             if(listitem == 3)//the listitem3, defines the number one option of the dialog
  461.             {
  462.                 if(GetPlayerScore(playerid) >= 1000)//if player have 1000 score then  he can choose this class
  463.                 {
  464.                     SendClientMessage(playerid, COLOR_WHITE, "You chose the Engineer as your class.");
  465.                     ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Engineer Class:", "{F81414}Abilities:\n{FFFFFF}A Strong Class.\n{FFFFFF}Can Drive Tanks\n{F81414}Weapons:\nSpas-12\n{FFFFFF}Deagle\n{FFFFFF}RPG\n{FFFFFF}Grenade", "Play","");
  466.                     gPlayerClass[playerid] = ENGINEER;//setting the class to Engineer
  467.                     PickedClass[playerid] = 1;
  468.                     SetPlayerVirtualWorld(playerid, 0);
  469.                     TogglePlayerControllable(playerid, 1);
  470.                     ResetPlayerWeapons(playerid);
  471.                     GivePlayerWeapon(playerid, 27, 70);//SPAS-12
  472.                     GivePlayerWeapon(playerid, 24, 30);//Deagle
  473.                     GivePlayerWeapon(playerid, 35, 2);//rpg
  474.                     GivePlayerWeapon(playerid, 16, 3);//Grenades
  475.                 }
  476.             }
  477.  
  478.             if(listitem == 4)//the listitem4, defines the number one option of the dialog
  479.             {
  480.                 if(GetPlayerScore(playerid) >= 1500)//if player have 1500 score then  he can choose this class
  481.                 {
  482.                     SendClientMessage(playerid, COLOR_WHITE, "You chose the Airforce as your class.");
  483.                     ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Airforce Class:", "{F81414}Abilities:\n{FFFFFF}A Airforce class, Can drive hunter, hydra & sea sparrow.\n\n{F81414}Weapons:\n\n{FFFFFF}Deagle\n{FFFFFF}Molotov\n{FFFFFF}Shotgun", "Play","");
  484.                     gPlayerClass[playerid] = AIRFORCE;//setting the class to Airforce
  485.                     PickedClass[playerid] = 1;
  486.                     SetPlayerVirtualWorld(playerid, 0);
  487.                     TogglePlayerControllable(playerid, 1);
  488.                     ResetPlayerWeapons(playerid);
  489.                     GivePlayerWeapon(playerid, 24, 200);//deagle
  490.                     GivePlayerWeapon(playerid, 17, 4);//moltove
  491.                     GivePlayerWeapon(playerid, 25, 100);//shotgun
  492.                 }
  493.             }
  494.  
  495.             if(listitem == 5)//the listitem5, defines the number one option of the dialog
  496.             {
  497.                 if(GetPlayerScore(playerid) >= 0)//if player have 0 score then  he can choose this class
  498.                 {
  499.                     SendClientMessage(playerid, COLOR_WHITE, "You chose the Spy as your class.");
  500.                     ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Spy Class:", "{F81414}Abilities:\n{FFFFFF}A Victim class, Can Disguise to enemy assaults by /dis\n\n{F81414}Weapons:\n\n{FFFFFF}Mp5\n{FFFFFF}Silent Pistol\n{FFFFFF}M4\n{FFFFFF}Deagle", "Play","");
  501.                     gPlayerClass[playerid] = SPY;//setting the class to Spy
  502.                     PickedClass[playerid] = 1;
  503.                     SetPlayerVirtualWorld(playerid, 0);
  504.                     TogglePlayerControllable(playerid, 1);
  505.                     ResetPlayerWeapons(playerid);
  506.                     GivePlayerWeapon(playerid, 29, 200);//mp5
  507.                     GivePlayerWeapon(playerid, 23, 200);//silent pistol
  508.                     GivePlayerWeapon(playerid, 31, 200);//m4
  509.                     GivePlayerWeapon(playerid, 24, 200);//deagle
  510.                 }
  511.             }
  512.             if(listitem == 5)//the listitem5, defines the number one option of the dialog
  513.             {
  514.                 if(GetPlayerScore(playerid) >= 5000)//if player have 0 score then  he can choose this class
  515.                 {
  516.                     SendClientMessage(playerid, COLOR_WHITE, "You chose the Special Forces as your class.");
  517.                     ShowPlayerDialog(playerid, 11, DIALOG_STYLE_MSGBOX, "{6EF83C}Special Force Class:", "{F81414}Abilities:\n{FFFFFF}A Powerful Class\nImproved Weapons and Tactics\n{F81414}Weapons:\n\n{FFFFFF}Mp5\n{FFFFFF}Spas-12\n{FFFFFF}M4\n{FFFFFF}Deagle", "Play","");
  518.                     gPlayerClass[playerid] = SPECIAL_FORCE;//setting the class to Special Force
  519.                     PickedClass[playerid] = 1;
  520.                     SetPlayerVirtualWorld(playerid, 0);
  521.                     TogglePlayerControllable(playerid, 1);
  522.                     ResetPlayerWeapons(playerid);
  523.                     GivePlayerWeapon(playerid, 29, 200);//mp5
  524.                     GivePlayerWeapon(playerid, 27, 70);//SPAS-12
  525.                     GivePlayerWeapon(playerid, 31, 200);//m4
  526.                     GivePlayerWeapon(playerid, 24, 200);//deagle
  527.                 }
  528.             }
  529.             return 1;
  530.         }
  531.         return 1;
  532.     }
  533.     return true;
  534. }
  535.  
  536. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  537. {
  538.     return 1;
  539. }
Add Comment
Please, Sign In to add comment