Guest User

Fighting Styles

a guest
Oct 29th, 2012
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.29 KB | None | 0 0
  1. #include <a_samp>
  2. #include <mxINI>
  3.  
  4. enum pInfo {
  5. pStyle};
  6.  
  7. public OnPlayerConnect(playerid){
  8.     PlayerInfo[playerid][pStyle] = 4;
  9.     return (true);}
  10.  
  11. OnPlayerSave(playerid){
  12.     ini_setInteger(iniFile,"Style",PlayerInfo[playerid][pStyle]);
  13.     return (true);}
  14.  
  15. public OnPlayerLogin(playerid,password[]){
  16.     ini_getInteger(iniFile,"Style",PlayerInfo[playerid][pStyle]);
  17.     return (true);}
  18.  
  19. public OnPlayerCommandText(playerid, cmdtext[]){
  20.     if(!strcmp(cmd, "/style", true)) return ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Buy combat style", "ELBOW [500$] \nGRABKICK [1000$] \nKNEEHEAD [1500$] \nKUNGFU [5000$] \nBOXING [1000$] \nRemove the fighting style [FREE]", "buy", "closed");  
  21.     return (false);}
  22.  
  23. /*CMD:style(playerid, params[]) return ShowPlayerDialog(playerid, 777, DIALOG_STYLE_LIST, "Buy combat style", "ELBOW [500$] \nGRABKICK [1000$] \nKNEEHEAD [1500$] \nKUNGFU [5000$] \nBOXING [1000$] \nRemove the fighting style [FREE]", "buy", "closed");*/
  24.  
  25. public OnPlayerSpawn(playerid){
  26.     SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pStyle]);
  27.     return (true);}
  28.  
  29. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]){
  30. switch(dialogid)
  31. {
  32. case 777:
  33. {
  34. switch(listitem)
  35. {
  36.     case 0: PlayerInfo[playerid][pStyle] = 26,GivePlayerMoney(playerid,-500),SendClientMessage(playerid,-1,"{FFFFFF}You have successfully changed the style of fighting 'ELBOW'");
  37.     case 1: PlayerInfo[playerid][pStyle] = 15,GivePlayerMoney(playerid,-1000),SendClientMessage(playerid,-1,"{FFFFFF}You have successfully changed the style of fighting 'GRABKICK'");
  38.     case 2: PlayerInfo[playerid][pStyle] = 7,GivePlayerMoney(playerid,-1500),SendClientMessage(playerid,-1,"{FFFFFF}You have successfully changed the style of fighting 'KNEEHEAD'");
  39.     case 3: PlayerInfo[playerid][pStyle] = 6,GivePlayerMoney(playerid,-5000),SendClientMessage(playerid,-1,"{FFFFFF}You have successfully changed the style of fighting 'KUNGFU'");
  40.     case 4: PlayerInfo[playerid][pStyle] = 5,GivePlayerMoney(playerid,-100), SendClientMessage(playerid,-1,"{FFFFFF}You have successfully changed the style of fighting 'BOXING'");
  41.     case 5: PlayerInfo[playerid][pStyle] = 4,SendClientMessage(playerid, -1, "{FFFFFF}You have successfully removed the combat style");
  42. }  
  43.     return (true);}
Advertisement
Add Comment
Please, Sign In to add comment