Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.79 KB | None | 0 0
  1. Comando ==
  2.  
  3.     else if(strcmp(cmd,"/Switch",true)==0)
  4.     {
  5.        
  6.         new string[256];
  7.         format(string, 256, "{196E0C}» %s\n{104E8B}» %s\n{EBFF00}» %s\n{D3D3D3}» Sub\n{D3D3D3}» Play",TeamInfo[TeamA][Name],TeamInfo[TeamB][Name],TeamInfo[TeamC][Name]);
  8.          ShowPlayerDialog(playerid, DIALOG_SWITCH, DIALOG_STYLE_LIST, "» Switch:", string, "Okay", "Exit");
  9.         }
  10.         return 1;
  11.     }
  12.  
  13.  
  14. //OnDialogResponse
  15.  
  16.   if(dialogid == DIALOG_SWITCH)
  17.         {
  18.                  new string[256];
  19.                 new  SwitchStr[MaxString];
  20.                 if(response == 0)
  21.                 {
  22.                         format(string, 128, "{196E0C}» %s\n{104E8B}» %s\n{EBFF00}» %s\n{D3D3D3}» Sub\n{D3D3D3}» Play",TeamInfo[TeamA][Name],TeamInfo[TeamB][Name],TeamInfo[TeamC][Name]);
  23.                         ShowPlayerDialog(playerid, DIALOG_SWITCH, DIALOG_STYLE_LIST, "» Switch:", string, "Okay", "Exit");
  24.                         return 1;
  25.                 }
  26.                 if(response == 1)
  27.                 {
  28.                         if(listitem == 0) // A
  29.                         {
  30.                  new  Float:Angle, Float:x, Float:y, Float:z;
  31.                  PlayerInfo[playerid][PlayerTeam]=TeamA;
  32.                 SetSpawnInfo(playerid,0,TeamInfo[TeamA][Skin],x,y,z,Angle,0,0,0,0,0,0);
  33.                 format(SwitchStr,sizeof(SwitchStr),"* \"%s\" Trocou para o time: %s.",PlayerInfo[playerid][PlayerName],TeamInfo[TeamA][Name]);
  34.                 SendClientMessageToAll(TeamInfo[TeamA][Color],SwitchStr);
  35.             }
  36.                         }
  37.                         if(listitem == 1) // B
  38.                         {
  39.                  new  Float:Angle, Float:x, Float:y, Float:z;
  40.                 PlayerInfo[playerid][PlayerTeam]=TeamB;
  41.                 SetSpawnInfo(playerid,0,TeamInfo[TeamB][Skin],x,y,z,Angle,0,0,0,0,0,0);
  42.                 format(SwitchStr,sizeof(SwitchStr),"* \"%s\" Trocou para o time: %s.",PlayerInfo[playerid][PlayerName],TeamInfo[TeamB][Name]);
  43.                 SendClientMessageToAll(TeamInfo[TeamB][Color],SwitchStr);
  44.                         }
  45.                         if(listitem == 2) //REF
  46.                         {
  47.                   new  Float:Angle, Float:x, Float:y, Float:z;
  48.                  PlayerInfo[playerid][PlayerTeam]=TeamC;
  49.                 SetSpawnInfo(playerid,0,TeamInfo[TeamC][Skin],x,y,z,Angle,0,0,0,0,0,0);
  50.                 format(SwitchStr,sizeof(SwitchStr),"* \"%s\" Trocou para o time: %s.",PlayerInfo[playerid][PlayerName],TeamInfo[TeamC][Name]);
  51.                 SendClientMessageToAll(TeamInfo[TeamC][Color],SwitchStr);
  52.                         }
  53.                         if(listitem == 3) //Sub
  54.                         {
  55.          if (PlayerInRound[playerid]==true)                 SendClientMessage(playerid,ServerColor2,"* Você não pode usar esse comando enquanto joga um Round.");
  56.         else if (IsPlayerInAnyVehicle(playerid))            SendClientMessage(playerid,ServerColor2,"* Você não pode usa esse comando dentro de um veiculo.");
  57.         else if (PlayerInfo[playerid][PlayerStatus]==Sub)   SendClientMessage(playerid,ServerColor2,"* Você Já está como reserva.");
  58.         else
  59.         {
  60.             PlayerInfo[playerid][PlayerStatus]=Sub;
  61.             new  Float:Angle, Float:x, Float:y, Float:z;
  62.             new  PlayerSkin=GetPlayerSkin(playerid);
  63.             new interior=GetPlayerInterior(playerid);
  64.             GetPlayerPos(playerid, x, y, z),GetPlayerFacingAngle(playerid,Angle);
  65.             SetSpawnInfo(playerid,0,PlayerSkin,x,y,z,Angle,0,0,0,0,0,0);
  66.             SpawnPlayer(playerid);
  67.             SetPlayerInterior(playerid,interior);
  68.             new Str[256];
  69.             format(Str,MaxString,"* \"%s\" Foi para a reserva.",PlayerInfo[playerid][PlayerName]);
  70.             SendClientMessageToAll(ServerColor3,Str);
  71.         }
  72.                         }
  73.                         if(listitem == 4) //play
  74.                         {
  75.         if (PlayerInRound[playerid]==true)                      SendClientMessage(playerid,ServerColor2,"* Você não pode usar esse comando enquanto joga um round.");
  76.         else if (IsPlayerInAnyVehicle(playerid))                SendClientMessage(playerid,ServerColor2,"* Você não pode usar esse comando dentro de um veiculo.");
  77.         else if (PlayerInfo[playerid][PlayerStatus]==Waiting)   SendClientMessage(playerid,ServerColor2,"* Você Já está como titular.");
  78.         else if (PlayerInfo[playerid][Duel]>0)                  SendClientMessage(playerid,ServerColor2,"* Você não pode usar em um duelo.");
  79.         else
  80.         {
  81.             PlayerInfo[playerid][PlayerStatus]=Waiting;
  82.             new  Float:Angle, Float:x, Float:y, Float:z;
  83.             new  PlayerSkin=GetPlayerSkin(playerid);
  84.             new interior=GetPlayerInterior(playerid);
  85.             GetPlayerPos(playerid, x, y, z),GetPlayerFacingAngle(playerid,Angle);
  86.             SetSpawnInfo(playerid,0,PlayerSkin,x,y,z,Angle,0,0,0,0,0,0);
  87.             SpawnPlayer(playerid);
  88.             SetPlayerInterior(playerid,interior);
  89.             new Str[256];
  90.             format(Str,MaxString,"* \"%s\" Veio para o time titular.",PlayerInfo[playerid][PlayerName]);
  91.             SendClientMessageToAll(ServerColor3,Str);
  92.         }
  93.                         }
  94.                 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement