Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define SecondaryLAUNCHER 1
- #define Createclass 2
- #define Primary 3
- #define Secondary 4
- #define Lethal 5
- #define PrimarySMG 6
- #define PrimaryMACHINE 7
- #define PrimarySHOTGUN 8
- #define PrimaryRIFLE 9
- #define SecondaryPISTOL 10
- enum primary
- {
- Tec9,
- Micro,
- SMG,
- M4,
- AK47,
- Shotgun,
- Sawnoff,
- Combat,
- Rifle,
- Sniper,
- };
- enum secondary
- {
- mm9,
- Silenced,
- Deagle,
- RPG,
- HSRPG,
- };
- enum lethal
- {
- Grenade,
- Tear,
- Molotov,
- Satchel,
- };
- new PlayerPrimary[MAX_PLAYERS][primary];
- new PlayerSecondary[MAX_PLAYERS][secondary];
- new PlayerLethal[MAX_PLAYERS][lethal];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Create-A-Class FS by [MNC]Azz...");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- PlayerPrimary[playerid][Tec9]=0;
- PlayerPrimary[playerid][Micro]=0;
- PlayerPrimary[playerid][SMG]=0;
- PlayerPrimary[playerid][M4]=0;
- PlayerPrimary[playerid][AK47]=0;
- PlayerPrimary[playerid][Shotgun]=0;
- PlayerPrimary[playerid][Sawnoff]=0;
- PlayerPrimary[playerid][Combat]=0;
- PlayerPrimary[playerid][Rifle]=0;
- PlayerPrimary[playerid][Sniper]=0;
- PlayerSecondary[playerid][mm9]=0;
- PlayerSecondary[playerid][Silenced]=0;
- PlayerSecondary[playerid][Deagle]=0;
- PlayerSecondary[playerid][RPG]=0;
- PlayerSecondary[playerid][HSRPG]=0;
- PlayerLethal[playerid][Satchel]=0;
- PlayerLethal[playerid][Grenade]=0;
- PlayerLethal[playerid][Tear]=0;
- PlayerLethal[playerid][Molotov]=0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- PlayerPrimary[playerid][Tec9]=0;
- PlayerPrimary[playerid][Micro]=0;
- PlayerPrimary[playerid][SMG]=0;
- PlayerPrimary[playerid][M4]=0;
- PlayerPrimary[playerid][AK47]=0;
- PlayerPrimary[playerid][Shotgun]=0;
- PlayerPrimary[playerid][Sawnoff]=0;
- PlayerPrimary[playerid][Combat]=0;
- PlayerPrimary[playerid][Rifle]=0;
- PlayerPrimary[playerid][Sniper]=0;
- PlayerSecondary[playerid][mm9]=0;
- PlayerSecondary[playerid][Silenced]=0;
- PlayerSecondary[playerid][Deagle]=0;
- PlayerSecondary[playerid][RPG]=0;
- PlayerSecondary[playerid][HSRPG]=0;
- PlayerLethal[playerid][Satchel]=0;
- PlayerLethal[playerid][Grenade]=0;
- PlayerLethal[playerid][Tear]=0;
- PlayerLethal[playerid][Molotov]=0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SendClientMessage(playerid,0xFFFF00AA,"This server uses Create-A-Class FS by [MNC]Azz...");
- SendClientMessage(playerid,0xFFFF00AA,"Use /createclass to customise your weapon class...");
- //PRIMARY WEAPONS
- if(PlayerPrimary[playerid][Tec9]==1)
- {
- GivePlayerWeapon(playerid,32,200);
- }
- else if(PlayerPrimary[playerid][Micro]==1)
- {
- GivePlayerWeapon(playerid,28,200);
- }
- else if(PlayerPrimary[playerid][SMG]==1)
- {
- GivePlayerWeapon(playerid,28,200);
- }
- else if(PlayerPrimary[playerid][M4]==1)
- {
- GivePlayerWeapon(playerid,31,200);
- }
- else if(PlayerPrimary[playerid][AK47]==1)
- {
- GivePlayerWeapon(playerid,30,200);
- }
- else if(PlayerPrimary[playerid][Shotgun]==1)
- {
- GivePlayerWeapon(playerid,25,200);
- }
- else if(PlayerPrimary[playerid][Sawnoff]==1)
- {
- GivePlayerWeapon(playerid,26,200);
- }
- else if(PlayerPrimary[playerid][Combat]==1)
- {
- GivePlayerWeapon(playerid,27,200);
- }
- else if(PlayerPrimary[playerid][Rifle]==1)
- {
- GivePlayerWeapon(playerid,33,200);
- }
- else if(PlayerPrimary[playerid][Sniper]==1)
- {
- GivePlayerWeapon(playerid,34,200);
- }
- //SECONDARY WEAPONS
- if(PlayerSecondary[playerid][mm9]==1)
- {
- GivePlayerWeapon(playerid,22,200);
- }
- else if(PlayerSecondary[playerid][Silenced]==1)
- {
- GivePlayerWeapon(playerid,23,200);
- }
- else if(PlayerSecondary[playerid][Deagle]==1)
- {
- GivePlayerWeapon(playerid,24,200);
- }
- else if(PlayerSecondary[playerid][RPG]==1)
- {
- GivePlayerWeapon(playerid,35,200);
- }
- else if(PlayerSecondary[playerid][HSRPG]==1)
- {
- GivePlayerWeapon(playerid,36,200);
- }
- //LETHAL
- if(PlayerLethal[playerid][Grenade]==1)
- {
- GivePlayerWeapon(playerid,16,200);
- }
- else if(PlayerLethal[playerid][Tear]==1)
- {
- GivePlayerWeapon(playerid,17,200);
- }
- else if(PlayerLethal[playerid][Molotov]==1)
- {
- GivePlayerWeapon(playerid,18,200);
- }
- else if(PlayerLethal[playerid][Satchel]==1)
- {
- GivePlayerWeapon(playerid,39,200);
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/createclass", cmdtext, true, 10) == 0)
- {
- ShowPlayerDialog(playerid,Createclass,DIALOG_STYLE_LIST,"Custom 1","PRIMARY\nSECONDARY\nLETHAL","Select","Back");
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == Createclass)
- {
- if(response)
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,Primary,DIALOG_STYLE_LIST,"PRIMARY","Sub Machine Guns\nMachine Guns\nShotguns\nRifles","Select","Back");
- return 1;
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,Secondary,DIALOG_STYLE_LIST,"SECONDARY","Pistols\nLaunchers","Select","Back");
- return 1;
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid,Lethal,DIALOG_STYLE_LIST,"LETHAL","Grenade\nTear Gas\nMolotov Coctail\nSatchel Bomb","Select","Back");
- return 1;
- }
- }
- else
- {
- ShowPlayerDialog(playerid,Createclass,DIALOG_STYLE_LIST,"Custom 1","PRIMARY\nSECONDARY\nLETHAL","Select","Back");
- return 1;
- }
- }
- if(dialogid == Primary)
- {
- if(response)
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,PrimarySMG,DIALOG_STYLE_LIST,"SMGs","Tec-9\nMicro SMG\nSMG","Select","Back");
- return 1;
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,PrimaryMACHINE,DIALOG_STYLE_LIST,"Machine Guns","M4\nAK47","Select","Back");
- return 1;
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid,PrimarySHOTGUN,DIALOG_STYLE_LIST,"Shotguns","Shotgun\nSawnoff Shotgun\nCombat Shotgun","Select","Back");
- return 1;
- }
- if(listitem == 3)
- {
- ShowPlayerDialog(playerid,PrimaryRIFLE,DIALOG_STYLE_LIST,"Rifles","Rifle\nSniper Rifle","Select","Back");
- return 1;
- }
- }
- else
- {
- ShowPlayerDialog(playerid,Createclass,DIALOG_STYLE_LIST,"Custom 1","PRIMARY\nSECONDARY\nLETHAL","Select","Back");
- return 1;
- }
- }
- if(dialogid == Secondary)
- {
- if(response)
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,SecondaryPISTOL,DIALOG_STYLE_LIST,"Pistols","9MM\nSilenced 9MM\nDeagle","Select","Back");
- return 1;
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid,SecondaryLAUNCHER,DIALOG_STYLE_LIST,"Launchers","RPG\nHeat Seaking RPG","Select","Back");
- return 1;
- }
- }
- else
- {
- ShowPlayerDialog(playerid,Createclass,DIALOG_STYLE_LIST,"Custom 1","PRIMARY\nSECONDARY\nLETHAL","Select","Back");
- return 1;
- }
- }
- if(dialogid == Lethal)
- {
- if(response)
- {
- if(listitem == 0)
- {
- SendClientMessage(playerid,0xFFFF00AA,"LETHAL Set To: Grenade...");
- PlayerLethal[playerid][Grenade]=1;
- PlayerLethal[playerid][Molotov]=0;
- PlayerLethal[playerid][Tear]=0;
- PlayerLethal[playerid][Satchel]=0;
- return 1;
- }
- if(listitem == 1)
- {
- SendClientMessage(playerid,0xFFFF00AA,"LETHAL Set To: Tear Gas...");
- PlayerLethal[playerid][Tear]=1;
- PlayerLethal[playerid][Satchel]=0;
- PlayerLethal[playerid][Grenade]=0;
- PlayerLethal[playerid][Molotov]=0;
- return 1;
- }
- if(listitem == 2)
- {
- SendClientMessage(playerid,0xFFFF00AA,"LETHAL Set To: Molotov Coctail...");
- PlayerLethal[playerid][Molotov]=1;
- PlayerLethal[playerid][Satchel]=0;
- PlayerLethal[playerid][Tear]=0;
- PlayerLethal[playerid][Grenade]=0;
- return 1;
- }
- if(listitem == 3)
- {
- SendClientMessage(playerid,0xFFFF00AA,"LETHAL Set To: Satchel Bomb...");
- PlayerLethal[playerid][Satchel]=1;
- PlayerLethal[playerid][Grenade]=0;
- PlayerLethal[playerid][Tear]=0;
- PlayerLethal[playerid][Molotov]=0;
- return 1;
- }
- }
- else
- {
- ShowPlayerDialog(playerid,Createclass,DIALOG_STYLE_LIST,"Custom 1","PRIMARY\nSECONDARY\nLETHAL","Select","Back");
- return 1;
- }
- }
- if(dialogid == PrimarySMG)
- {
- if(response)
- {
- if(listitem == 0)
- {
- SendClientMessage(playerid,0xFFFF00AA,"PRIMARY Set To: Tec-9...");
- PlayerPrimary[playerid][Tec9]=1;
- PlayerPrimary[playerid][Micro]=0;
- PlayerPrimary[playerid][SMG]=0;
- PlayerPrimary[playerid][M4]=0;
- PlayerPrimary[playerid][AK47]=0;
- PlayerPrimary[playerid][Shotgun]=0;
- PlayerPrimary[playerid][Sawnoff]=0;
- PlayerPrimary[playerid][Combat]=0;
- PlayerPrimary[playerid][Rifle]=0;
- PlayerPrimary[playerid][Sniper]=0;
- return 1;
- }
- if(listitem == 1)
- {
- SendClientMessage(playerid,0xFFFF00AA,"PRIMARY Set To: Micro SMG...");
- PlayerPrimary[playerid][Tec9]=0;
- PlayerPrimary[playerid][Micro]=1;
- PlayerPrimary[playerid][SMG]=0;
- PlayerPrimary[playerid][M4]=0;
- PlayerPrimary[playerid][AK47]=0;
- PlayerPrimary[playerid][Shotgun]=0;
- PlayerPrimary[playerid][Sawnoff]=0;
- PlayerPrimary[playerid][Combat]=0;
- PlayerPrimary[playerid][Rifle]=0;
- PlayerPrimary[playerid][Sniper]=0;
- return 1;
- }
- if(listitem == 2)
- {
- SendClientMessage(playerid,0xFFFF00AA,"PRIMARY Set To: SMG...");
- PlayerPrimary[playerid][Tec9]=0;
- PlayerPrimary[playerid][Micro]=0;
- PlayerPrimary[playerid][SMG]=1;
- PlayerPrimary[playerid][M4]=0;
- PlayerPrimary[playerid][AK47]=0;
- PlayerPrimary[playerid][Shotgun]=0;
- PlayerPrimary[playerid][Sawnoff]=0;
- PlayerPrimary[playerid][Combat]=0;
- PlayerPrimary[playerid][Rifle]=0;
- PlayerPrimary[playerid][Sniper]=0;
- return 1;
- }
- }
- else
- {
- ShowPlayerDialog(playerid,Createclass,DIALOG_STYLE_LIST,"Custom 1","PRIMARY\nSECONDARY\nLETHAL","Select","Back");
- return 1;
- }
- }
- if(dialogid == PrimaryMACHINE)
- {
- if(response)
- {
- if(listitem == 0)
- {
- SendClientMessage(playerid,0xFFFF00AA,"PRIMARY Set To: M4...");
- PlayerPrimary[playerid][Tec9]=0;
- PlayerPrimary[playerid][Micro]=0;
- PlayerPrimary[playerid][SMG]=0;
- PlayerPrimary[playerid][M4]=1;
- PlayerPrimary[playerid][AK47]=0;
- PlayerPrimary[playerid][Shotgun]=0;
- PlayerPrimary[playerid][Sawnoff]=0;
- PlayerPrimary[playerid][Combat]=0;
- PlayerPrimary[playerid][Rifle]=0;
- PlayerPrimary[playerid][Sniper]=0;
- return 1;
- }
- if(listitem == 1)
- {
- SendClientMessage(playerid,0xFFFF00AA,"PRIMARY Set To: AK47...");
- PlayerPrimary[playerid][Tec9]=0;
- PlayerPrimary[playerid][Micro]=0;
- PlayerPrimary[playerid][SMG]=0;
- PlayerPrimary[playerid][M4]=0;
- PlayerPrimary[playerid][AK47]=1;
- PlayerPrimary[playerid][Shotgun]=0;
- PlayerPrimary[playerid][Sawnoff]=0;
- PlayerPrimary[playerid][Combat]=0;
- PlayerPrimary[playerid][Rifle]=0;
- PlayerPrimary[playerid][Sniper]=0;
- return 1;
- }
- }
- else
- {
- ShowPlayerDialog(playerid,Createclass,DIALOG_STYLE_LIST,"Custom 1","PRIMARY\nSECONDARY\nLETHAL","Select","Back");
- return 1;
- }
- }
- if(dialogid == PrimarySHOTGUN)
- {
- if(response)
- {
- if(listitem == 0)
- {
- SendClientMessage(playerid,0xFFFF00AA,"PRIMARY Set To: Shotgun...");
- PlayerPrimary[playerid][Tec9]=0;
- PlayerPrimary[playerid][Micro]=0;
- PlayerPrimary[playerid][SMG]=0;
- PlayerPrimary[playerid][M4]=0;
- PlayerPrimary[playerid][AK47]=0;
- PlayerPrimary[playerid][Shotgun]=1;
- PlayerPrimary[playerid][Sawnoff]=0;
- PlayerPrimary[playerid][Combat]=0;
- PlayerPrimary[playerid][Rifle]=0;
- PlayerPrimary[playerid][Sniper]=0;
- return 1;
- }
- if(listitem == 1)
- {
- SendClientMessage(playerid,0xFFFF00AA,"PRIMARY Set To: Sawnoff Shotgun...");
- PlayerPrimary[playerid][Tec9]=0;
- PlayerPrimary[playerid][Micro]=0;
- PlayerPrimary[playerid][SMG]=0;
- PlayerPrimary[playerid][M4]=0;
- PlayerPrimary[playerid][AK47]=0;
- PlayerPrimary[playerid][Shotgun]=0;
- PlayerPrimary[playerid][Sawnoff]=1;
- PlayerPrimary[playerid][Combat]=0;
- PlayerPrimary[playerid][Rifle]=0;
- PlayerPrimary[playerid][Sniper]=0;
- return 1;
- }
- if(listitem == 2)
- {
- SendClientMessage(playerid,0xFFFF00AA,"PRIMARY Set To: Combat Shotgun...");
- PlayerPrimary[playerid][Tec9]=0;
- PlayerPrimary[playerid][Micro]=0;
- PlayerPrimary[playerid][SMG]=0;
- PlayerPrimary[playerid][M4]=0;
- PlayerPrimary[playerid][AK47]=0;
- PlayerPrimary[playerid][Shotgun]=0;
- PlayerPrimary[playerid][Sawnoff]=0;
- PlayerPrimary[playerid][Combat]=1;
- PlayerPrimary[playerid][Rifle]=0;
- PlayerPrimary[playerid][Sniper]=0;
- return 1;
- }
- }
- else
- {
- ShowPlayerDialog(playerid,Createclass,DIALOG_STYLE_LIST,"Custom 1","PRIMARY\nSECONDARY\nLETHAL","Select","Back");
- return 1;
- }
- }
- if(dialogid == PrimaryRIFLE)
- {
- if(response)
- {
- if(listitem == 0)
- {
- SendClientMessage(playerid,0xFFFF00AA,"PRIMARY Set To: Rifle...");
- PlayerPrimary[playerid][Tec9]=0;
- PlayerPrimary[playerid][Micro]=0;
- PlayerPrimary[playerid][SMG]=0;
- PlayerPrimary[playerid][M4]=0;
- PlayerPrimary[playerid][AK47]=0;
- PlayerPrimary[playerid][Shotgun]=0;
- PlayerPrimary[playerid][Sawnoff]=0;
- PlayerPrimary[playerid][Combat]=0;
- PlayerPrimary[playerid][Rifle]=1;
- PlayerPrimary[playerid][Sniper]=0;
- return 1;
- }
- if(listitem == 1)
- {
- SendClientMessage(playerid,0xFFFF00AA,"PRIMARY Set To: Sniper Rifle...");
- PlayerPrimary[playerid][Tec9]=0;
- PlayerPrimary[playerid][Micro]=0;
- PlayerPrimary[playerid][SMG]=0;
- PlayerPrimary[playerid][M4]=0;
- PlayerPrimary[playerid][AK47]=0;
- PlayerPrimary[playerid][Shotgun]=0;
- PlayerPrimary[playerid][Sawnoff]=0;
- PlayerPrimary[playerid][Combat]=0;
- PlayerPrimary[playerid][Rifle]=0;
- PlayerPrimary[playerid][Sniper]=1;
- return 1;
- }
- }
- else
- {
- ShowPlayerDialog(playerid,Createclass,DIALOG_STYLE_LIST,"Custom 1","PRIMARY\nSECONDARY\nLETHAL","Select","Back");
- return 1;
- }
- }
- if(dialogid == SecondaryPISTOL)
- {
- if(response)
- {
- if(listitem == 0)
- {
- SendClientMessage(playerid,0xFFFF00AA,"SECONDARY Set To: 9MM...");
- PlayerSecondary[playerid][mm9]=1;
- PlayerSecondary[playerid][Silenced]=0;
- PlayerSecondary[playerid][Deagle]=0;
- PlayerSecondary[playerid][RPG]=0;
- PlayerSecondary[playerid][HSRPG]=0;
- return 1;
- }
- if(listitem == 1)
- {
- SendClientMessage(playerid,0xFFFF00AA,"SECONDARY Set To: Silenced 9MM...");
- PlayerSecondary[playerid][mm9]=0;
- PlayerSecondary[playerid][Silenced]=1;
- PlayerSecondary[playerid][Deagle]=0;
- PlayerSecondary[playerid][RPG]=0;
- PlayerSecondary[playerid][HSRPG]=0;
- return 1;
- }
- if(listitem == 2)
- {
- SendClientMessage(playerid,0xFFFF00AA,"SECONDARY Set To: Deagle...");
- PlayerSecondary[playerid][mm9]=0;
- PlayerSecondary[playerid][Silenced]=0;
- PlayerSecondary[playerid][Deagle]=1;
- PlayerSecondary[playerid][RPG]=0;
- PlayerSecondary[playerid][HSRPG]=0;
- return 1;
- }
- }
- else
- {
- ShowPlayerDialog(playerid,Createclass,DIALOG_STYLE_LIST,"Custom 1","PRIMARY\nSECONDARY\nLETHAL","Select","Back");
- return 1;
- }
- }
- if(dialogid == SecondaryLAUNCHER)
- {
- if(response)
- {
- if(listitem == 0)
- {
- SendClientMessage(playerid,0xFFFF00AA,"SECONDARY Set To: RPG...");
- PlayerSecondary[playerid][mm9]=0;
- PlayerSecondary[playerid][Silenced]=0;
- PlayerSecondary[playerid][Deagle]=0;
- PlayerSecondary[playerid][RPG]=1;
- PlayerSecondary[playerid][HSRPG]=0;
- return 1;
- }
- if(listitem == 1)
- {
- SendClientMessage(playerid,0xFFFF00AA,"SECONDARY Set To: Heat Seaking RPG...");
- PlayerSecondary[playerid][mm9]=0;
- PlayerSecondary[playerid][Silenced]=0;
- PlayerSecondary[playerid][Deagle]=0;
- PlayerSecondary[playerid][RPG]=0;
- PlayerSecondary[playerid][HSRPG]=1;
- return 1;
- }
- }
- else
- {
- ShowPlayerDialog(playerid,Createclass,DIALOG_STYLE_LIST,"Custom 1","PRIMARY\nSECONDARY\nLETHAL","Select","Back");
- return 1;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement