Guest User

RC BATTLE Command

a guest
Mar 2nd, 2012
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.53 KB | None | 0 0
  1. /*              Well I bring to you My First FS.
  2.         Well it was developed from scratch, it was nothing to do =).
  3.                 well this is pretty simple ta v.1 intão same.
  4.                     Do not remove the Credits
  5.                     This FS was made of heart!
  6.               Soon I'll be here again to V.2 Release
  7.              
  8.              
  9.                   - = - = - = -
  10.                   - = - = - = -
  11.  - = - = - = - = (MAGNETICLOVE-) = - = - = -
  12.  - = - = - = - = (MAGNETICLOVE-) = - = - = -
  13.                   - = - = - = -
  14.                   - = - = - = -
  15.  
  16. */
  17.  
  18. #include                                <    a_samp     >
  19. #include                                <     zcmd      >
  20. #include                                <    sscanf2    >
  21. #include                                <    missel     >
  22.  
  23.  
  24. new challenger;
  25. new opponent;
  26.  
  27. new Vehicle;
  28.  
  29. new bool:Battle[MAX_PLAYERS];
  30.  
  31.  
  32. public OnFilterScriptInit()
  33. {
  34.     print("\n--------------------------------------");
  35.     print("RC BATTLE COMBAT");
  36.     print("--------------------------------------\n");
  37.     return 1;
  38. }
  39.  
  40. public OnFilterScriptExit()
  41. {
  42.     return 1;
  43. }
  44.  
  45. public OnPlayerRequestClass(playerid, classid)
  46. {
  47.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  48.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  49.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  50.     return 1;
  51. }
  52.  
  53. COMMAND:createrc(playerid, params[])
  54. {
  55.     new str[200];
  56.     new Nome[MAX_PLAYER_NAME];
  57.     GetPlayerName(playerid, Nome, 24);
  58.     if(Battle[playerid]) return SendClientMessage(playerid, -1, "{5FFF00}Player Has Some In Battle");
  59.     if(sscanf(params, "i", opponent)) return SendClientMessage(playerid, -1, "{8C8C8C}Use /createrc {5FFF00}[ID]");
  60.     if(!IsPlayerConnected(opponent)) return SendClientMessage(playerid, -1, "ERROR:{8C8C8C} player is not connected !");
  61.     Battle[playerid] = true;
  62.     format(str, sizeof(str), "{0023FF}the player {5FFF00}%s {0023FF}is inviting you\nfor a battle in {5FFF00}RC Battle Command, {0023FF}want to accept?", Nome);
  63.     ShowPlayerDialog(opponent, 1, DIALOG_STYLE_MSGBOX, "RC Battle Command", str, "Confirm","Cancel");
  64.     return 1;
  65. }
  66. COMMAND:givebattle(playerid)
  67. {
  68.     if(!Battle[playerid]) return SendClientMessage(playerid, -1, "You're not giving up the fight to");
  69.     Battle[playerid] = false;
  70.     SpawnPlayer(playerid);
  71.     return 1;
  72. }
  73. COMMAND:missile(playerid)
  74. {
  75.     AddVehicleMissiles(Vehicle,1.1,0.0);
  76.     return 1;
  77. }
  78.  
  79. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  80. {
  81.     VM_OnPlayerKeyStateChange(playerid,newkeys);
  82.     return 1;
  83. }
  84.  
  85. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  86. {
  87.     if(dialogid == 1)
  88.     {
  89.         if(!response) return SendClientMessage(challenger, -1, "{2DFF00}He refused to fight");
  90.         SendClientMessage(challenger, -1, "{2DFF00}He Accept Your Invitation");
  91.         SetPlayerInterior(challenger, 10);
  92.         SetPlayerInterior(opponent, 10);
  93.         SetPlayerPos(challenger, -974.2322,1061.0780,1345.6754);
  94.         SetPlayerPos(opponent, -1130.2719,1057.8379,1346.4141);
  95.         new
  96.         Float:x,
  97.         Float:y,
  98.         Float:z
  99.         ;
  100.         GetPlayerPos(playerid,x,y,z);
  101.         Vehicle = 0;
  102.         Vehicle = CreateVehicle(564,-974.2322,1061.0780,1345.6754,0.0,-1,-1,1000);
  103.         Vehicle = CreateVehicle(564,-1130.2719,1057.8379,1346.4141,0.0,-1,-1,1000);
  104.         AddVehicleMissiles(Vehicle,1.1,0.0);
  105.         PutPlayerInVehicle(opponent,Vehicle,0);
  106.         PutPlayerInVehicle(challenger, Vehicle,0);
  107.         LinkVehicleToInterior(Vehicle, 10);
  108.         LinkVehicleToInterior(Vehicle, 10);
  109.         PutPlayerInVehicle(challenger, Vehicle, 0);
  110.         PutPlayerInVehicle(opponent, Vehicle, 0);
  111.         return 1;
  112.     }
  113.     return 1;
  114. }
  115.  
  116. public VM_OnVehicleFire(vehicleid,slot)
  117. {
  118.     return 1;
  119. }
Advertisement
Add Comment
Please, Sign In to add comment