Advertisement
Guest User

Brasil Football Cahmpions

a guest
Oct 8th, 2011
676
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 48.44 KB | None | 0 0
  1. #include <a_samp>
  2. #include <Dini>
  3. #include <dutils>
  4. #include <core>
  5. #include <utils>
  6. #include <float>
  7. #include <DUDB>
  8.  
  9. #define COLOR_GRAD1 0xB4B5B7FF
  10. #define COLOR_GRAD2 0xBFC0C2FF
  11. #define COLOR_BAD 0xC10000FF
  12. #define COLOR_GOOD 0xFAD029FF
  13. #define COLOR_GRAD3 0xCBCCCEFF
  14. #define COLOR_GRAD4 0xD8D8D8FF
  15. #define COLOR_GRAD5 0xE3E3E3FF
  16. #define COLOR_GRAD6 0xF0F0F0FF
  17. #define COLOR_GREY 0xAFAFAFAA
  18. #define COLOR_GREEN 0x33AA33AA
  19. #define COLOR_RED 0xAA3333AA
  20. #define COLOR_LIGHTRED 0xFF6347AA
  21. #define COLOR_LIGHTBLUE 0x33CCFFAA
  22. #define COLOR_LIGHTGREEN 0x9ACD32AA
  23. #define COLOR_YELLOW 0xFFFF00AA
  24. #define COLOR_YELLOW2 0xF5DEB3AA
  25. #define COLOR_WHITE 0xFFFFFFAA
  26. #define COLOR_FADE1 0xE6E6E6E6
  27. #define COLOR_FADE2 0xC8C8C8C8
  28. #define COLOR_FADE3 0xAAAAAAAA
  29. #define COLOR_FADE4 0x8C8C8C8C
  30. #define COLOR_FADE5 0x6E6E6E6E
  31. #define COLOR_PURPLE 0xC2A2DAAA
  32. #define COLOR_DBLUE 0x2641FEAA
  33. #define COLOR_ALLDEPT 0xFF8282AA
  34. #define COLOR_NEWS 0xFFA500AA
  35. #define COLOR_OOC 0xE0FFFFAA
  36. #define OBJECTIVE_COLOR 0x64000064
  37. #define TEAM_GREEN_COLOR 0xFFFFFFAA
  38. #define TEAM_JOB_COLOR 0xFFB6C1AA
  39. #define TEAM_HIT_COLOR 0xFFFFFF00
  40. #define TEAM_BLUE_COLOR 0x8D8DFF00
  41. #define COLOR_ADD 0x63FF60AA
  42. #define TEAM_GROVE_COLOR 0x00D900C8
  43. #define TEAM_VAGOS_COLOR 0xFFC801C8
  44. #define TEAM_BALLAS_COLOR 0xD900D3C8
  45. #define TEAM_AZTECAS_COLOR 0x01FCFFC8
  46. #define TEAM_CYAN_COLOR 0xFF8282AA
  47. #define TEAM_ORANGE_COLOR 0xFF830000
  48. #define TEAM_COR_COLOR 0x39393900
  49. #define TEAM_BAR_COLOR 0x00D90000
  50. #define TEAM_TAT_COLOR 0xBDCB9200
  51. #define TEAM_CUN_COLOR 0xD900D300
  52. #define TEAM_STR_COLOR 0x01FCFF00
  53. #define TEAM_ADMIN_COLOR 0x00808000
  54. #define COLOR_INVIS 0xAFAFAF00
  55. #define COLOR_SPEC 0xBFC0C200
  56. #define l_red 0xFF0000AA
  57. #define l_green 0x33FF33AA
  58.  
  59. static gTeam[MAX_PLAYERS];
  60. #define TEAM_BLUE 1
  61. #define TEAM_RED 2
  62.  
  63. #pragma tabsize 0
  64.  
  65. new Text:Textdraw0;
  66. new Text:Textdraw1;
  67.  
  68. new Text:Textdraw3;
  69. new Text:Textdraw4;
  70.  
  71. new sendername[MAX_PLAYER_NAME];
  72.  
  73. forward SendClientMessageToAdmins(color,const string[],alevel);
  74. forward KeyChanges();
  75. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  76. forward ObjectToPoint(Float:radi, objectid, Float:x, Float:y, Float:z);
  77. forward IsAGoal();
  78. forward SpawnMe(playerid);
  79.  
  80. new footballdoor;
  81. new football;
  82. new playingfootball[MAX_PLAYERS];
  83. new matchstarted[MAX_PLAYERS];
  84. new teamselected[MAX_PLAYERS];
  85. new logged[MAX_PLAYERS];
  86. new spectator[MAX_PLAYERS];
  87.  
  88. new light1;
  89. new light2;
  90. new light3;
  91. new light4;
  92. new light5;
  93.  
  94. new level;
  95.  
  96. new lastentered[128];
  97.  
  98. new bluescore = 0;
  99. new redscore = 0;
  100.  
  101. new playername[MAX_PLAYER_NAME];
  102.  
  103. new player[MAX_PLAYER_NAME];
  104. new StrVar[256];
  105.  
  106. new aVehicleNames[212][] =
  107. {
  108.     {"Landstalker"},
  109.     {"Bravura"},
  110.     {"Buffalo"},
  111.     {"Linerunner"},
  112.     {"Perrenial"},
  113.     {"Sentinel"},
  114.     {"Dumper"},
  115.     {"Firetruck"},
  116.     {"Trashmaster"},
  117.     {"Stretch"},
  118.     {"Manana"},
  119.     {"Infernus"},
  120.     {"Voodoo"},
  121.     {"Pony"},
  122.     {"Mule"},
  123.     {"Cheetah"},
  124.     {"Ambulance"},
  125.     {"Leviathan"},
  126.     {"Moonbeam"},
  127.     {"Esperanto"},
  128.     {"Taxi"},
  129.     {"Washington"},
  130.     {"Bobcat"},
  131.     {"Mr Whoopee"},
  132.     {"BF Injection"},
  133.     {"Hunter"},
  134.     {"Premier"},
  135.     {"Enforcer"},
  136.     {"Securicar"},
  137.     {"Banshee"},
  138.     {"Predator"},
  139.     {"Bus"},
  140.     {"Rhino"},
  141.     {"Barracks"},
  142.     {"Hotknife"},
  143.     {"Trailer 1"},
  144.     {"Previon"},
  145.     {"Coach"},
  146.     {"Cabbie"},
  147.     {"Stallion"},
  148.     {"Rumpo"},
  149.     {"RC Bandit"},
  150.     {"Romero"},
  151.     {"Packer"},
  152.     {"Monster"},
  153.     {"Admiral"},
  154.     {"Squalo"},
  155.     {"Seasparrow"},
  156.     {"Pizzaboy"},
  157.     {"Tram"},
  158.     {"Trailer 2"},
  159.     {"Turismo"},
  160.     {"Speeder"},
  161.     {"Reefer"},
  162.     {"Tropic"},
  163.     {"Flatbed"},
  164.     {"Yankee"},
  165.     {"Caddy"},
  166.     {"Solair"},
  167.     {"Berkley's RC Van"},
  168.     {"Skimmer"},
  169.     {"PCJ-600"},
  170.     {"Faggio"},
  171.     {"Freeway"},
  172.     {"RC Baron"},
  173.     {"RC Raider"},
  174.     {"Glendale"},
  175.     {"Oceanic"},
  176.     {"Sanchez"},
  177.     {"Sparrow"},
  178.     {"Patriot"},
  179.     {"Quad"},
  180.     {"Coastguard"},
  181.     {"Dinghy"},
  182.     {"Hermes"},
  183.     {"Sabre"},
  184.     {"Rustler"},
  185.     {"ZR-350"},
  186.     {"Walton"},
  187.     {"Regina"},
  188.     {"Comet"},
  189.     {"BMX"},
  190.     {"Burrito"},
  191.     {"Camper"},
  192.     {"Marquis"},
  193.     {"Baggage"},
  194.     {"Dozer"},
  195.     {"Maverick"},
  196.     {"News Chopper"},
  197.     {"Rancher"},
  198.     {"FBI Rancher"},
  199.     {"Virgo"},
  200.     {"Greenwood"},
  201.     {"Jetmax"},
  202.     {"Hotring"},
  203.     {"Sandking"},
  204.     {"Blista Compact"},
  205.     {"Police Maverick"},
  206.     {"Boxville"},
  207.     {"Benson"},
  208.     {"Mesa"},
  209.     {"RC Goblin"},
  210.     {"Hotring Racer A"},
  211.     {"Hotring Racer B"},
  212.     {"Bloodring Banger"},
  213.     {"Rancher"},
  214.     {"Super GT"},
  215.     {"Elegant"},
  216.     {"Journey"},
  217.     {"Bike"},
  218.     {"Mountain Bike"},
  219.     {"Beagle"},
  220.     {"Cropdust"},
  221.     {"Stunt"},
  222.     {"Tanker"},
  223.     {"Roadtrain"},
  224.     {"Nebula"},
  225.     {"Majestic"},
  226.     {"Buccaneer"},
  227.     {"Shamal"},
  228.     {"Hydra"},
  229.     {"FCR-900"},
  230.     {"NRG-500"},
  231.     {"HPV1000"},
  232.     {"Cement Truck"},
  233.     {"Tow Truck"},
  234.     {"Fortune"},
  235.     {"Cadrona"},
  236.     {"FBI Truck"},
  237.     {"Willard"},
  238.     {"Forklift"},
  239.     {"Tractor"},
  240.     {"Combine"},
  241.     {"Feltzer"},
  242.     {"Remington"},
  243.     {"Slamvan"},
  244.     {"Blade"},
  245.     {"Freight"},
  246.     {"Streak"},
  247.     {"Vortex"},
  248.     {"Vincent"},
  249.     {"Bullet"},
  250.     {"Clover"},
  251.     {"Sadler"},
  252.     {"Firetruck LA"},
  253.     {"Hustler"},
  254.     {"Intruder"},
  255.     {"Primo"},
  256.     {"Cargobob"},
  257.     {"Tampa"},
  258.     {"Sunrise"},
  259.     {"Merit"},
  260.     {"Utility"},
  261.     {"Nevada"},
  262.     {"Yosemite"},
  263.     {"Windsor"},
  264.     {"Monster A"},
  265.     {"Monster B"},
  266.     {"Uranus"},
  267.     {"Jester"},
  268.     {"Sultan"},
  269.     {"Stratum"},
  270.     {"Elegy"},
  271.     {"Raindance"},
  272.     {"RC Tiger"},
  273.     {"Flash"},
  274.     {"Tahoma"},
  275.     {"Savanna"},
  276.     {"Bandito"},
  277.     {"Freight Flat"},
  278.     {"Streak Carriage"},
  279.     {"Kart"},
  280.     {"Mower"},
  281.     {"Duneride"},
  282.     {"Sweeper"},
  283.     {"Broadway"},
  284.     {"Tornado"},
  285.     {"AT-400"},
  286.     {"DFT-30"},
  287.     {"Huntley"},
  288.     {"Stafford"},
  289.     {"BF-400"},
  290.     {"Newsvan"},
  291.     {"Tug"},
  292.     {"Trailer 3"},
  293.     {"Emperor"},
  294.     {"Wayfarer"},
  295.     {"Euros"},
  296.     {"Hotdog"},
  297.     {"Club"},
  298.     {"Freight Carriage"},
  299.     {"Trailer 3"},
  300.     {"Andromada"},
  301.     {"Dodo"},
  302.     {"RC Cam"},
  303.     {"Launch"},
  304.     {"Police Car (LSPD)"},
  305.     {"Police Car (SFPD)"},
  306.     {"Police Car (LVPD)"},
  307.     {"Police Ranger"},
  308.     {"Picador"},
  309.     {"S.W.A.T. Van"},
  310.     {"Alpha"},
  311.     {"Phoenix"},
  312.     {"Glendale"},
  313.     {"Sadler"},
  314.     {"Luggage Trailer A"},
  315.     {"Luggage Trailer B"},
  316.     {"Stair Trailer"},
  317.     {"Boxville"},
  318.     {"Farm Plow"},
  319.     {"Utility Trailer"}
  320. };
  321.  
  322. main()
  323. {
  324.     print("Criador do Gamemode: Norn.");
  325.     print("Editor Andre Simpson");
  326. }
  327.  
  328. public OnGameModeInit()
  329. {
  330.     ShowPlayerMarkers(0);
  331.  
  332.     new wstring[128];
  333.     format(wstring, sizeof(wstring), "Corinthias: %d.", redscore);
  334.     Textdraw3 = TextDrawCreate(447.000000,389.000000,wstring);
  335.    
  336.     new pstring[128];
  337.     format(pstring, sizeof(pstring), "S.Paulo: %d.", bluescore);
  338.     Textdraw4 = TextDrawCreate(448.000000,409.000000,pstring);
  339.    
  340.     TextDrawAlignment(Textdraw3,0);
  341.     TextDrawAlignment(Textdraw4,0);
  342.     TextDrawBackgroundColor(Textdraw3,0x000000ff);
  343.     TextDrawBackgroundColor(Textdraw4,0x000000ff);
  344.     TextDrawFont(Textdraw3,3);
  345.     TextDrawLetterSize(Textdraw3,0.799999,1.700000);
  346.     TextDrawFont(Textdraw4,3);
  347.     TextDrawLetterSize(Textdraw4,0.699999,1.900000);
  348.     TextDrawColor(Textdraw3,0xff000099);
  349.     TextDrawColor(Textdraw4,0x0000ff99);
  350.     TextDrawSetOutline(Textdraw3,1);
  351.     TextDrawSetOutline(Textdraw4,1);
  352.     TextDrawSetProportional(Textdraw3,1);
  353.     TextDrawSetProportional(Textdraw4,1);
  354.     TextDrawSetShadow(Textdraw3,1);
  355.     TextDrawSetShadow(Textdraw4,1);
  356.  
  357.     SetTimer("IsAGoal", 100, true);
  358.     SetGameModeText("Champions Futebol V0.1");
  359.     AddPlayerClass(80,82.0761,2474.1331,16.4844,298.3470,0,0,0,0,0,0);
  360.     AddPlayerClass(81,82.0761,2474.1331,16.4844,298.3470,0,0,0,0,0,0);
  361.  
  362.     CreateObject(987, 126.753410, 2476.302246, 15.568080, 0.0000, 0.0000, 87.6625);
  363.     CreateObject(987, 127.431580, 2488.012451, 15.492184, 0.0000, 0.0000, 90.2409);
  364.     CreateObject(987, 127.529396, 2499.968506, 15.424900, 0.0000, 0.0000, 90.2409);
  365.     CreateObject(987, 127.499641, 2511.905762, 15.576437, 0.0000, 0.0000, 103.1324);
  366.     CreateObject(987, 40.457767, 2477.390137, 15.484375, 0.0000, 0.0000, 87.6625);
  367.     CreateObject(987, 40.889481, 2489.362549, 15.484375, 0.0000, 0.0000, 87.6625);
  368.     CreateObject(987, 42.184555, 2513.097656, 15.492184, 0.0000, 0.0000, 91.9597);
  369.     CreateObject(987, 41.426842, 2501.212402, 15.435890, 0.0000, 0.0000, 87.6625);
  370.     CreateObject(991, 123.923195, 2499.773682, 16.699615, 0.0000, 0.0000, 271.4780);
  371.     CreateObject(991, 123.915749, 2499.766846, 17.299606, 0.0000, 0.0000, 271.5818);
  372.     CreateObject(991, 122.619263, 2502.999756, 15.224634, 0.0000, 269.7591, 183.0601);
  373.     CreateObject(991, 122.701576, 2496.440674, 15.232431, 0.0000, 92.8192, 359.1406);
  374.     CreateObject(991, 122.860153, 2499.749756, 18.532404, 270.6186, 0.8594, 91.9597);
  375.     CreateObject(991, 42.785404, 2502.307617, 16.699615, 0.0000, 0.0000, 88.5220);
  376.     CreateObject(991, 42.789219, 2502.316895, 17.324606, 0.0000, 0.0000, 89.3814);
  377.     CreateObject(991, 44.011806, 2499.039551, 15.224638, 0.8594, 268.8997, 0.0000);
  378.     CreateObject(991, 43.965122, 2505.671387, 15.224638, 0.0000, 270.6185, 178.7630);
  379.     CreateObject(991, 43.904266, 2502.328125, 18.474588, 270.6186, 0.0000, 91.1003);
  380.     CreateObject(987, 40.356102, 2477.555176, 15.484375, 0.0000, 0.0000, 0.0000);
  381.     CreateObject(987, 52.347397, 2477.369873, 15.484375, 0.0000, 0.0000, 307.5744);
  382.     CreateObject(987, 60.896790, 2467.505859, 15.484375, 0.0000, 0.0000, 0.0000);
  383.     CreateObject(987, 71.755714, 2467.233643, 15.476620, 0.0000, 0.0000, 0.0000);
  384.     CreateObject(987, 83.599655, 2466.916504, 15.484375, 0.0000, 0.0000, 0.0000);
  385.     CreateObject(987, 95.548233, 2466.622559, 15.484375, 0.0000, 0.0000, 0.0000);
  386.     CreateObject(987, 107.717255, 2466.740479, 15.476620, 0.0000, 0.0000, 0.0000);
  387.     CreateObject(987, 119.643417, 2466.654541, 15.484375, 0.0000, 0.0000, 54.1445);
  388.     CreateObject(3819, 65.469414, 2469.961182, 16.474379, 0.0000, 0.0000, 270.6185);
  389.     CreateObject(3819, 72.679688, 2470.041260, 16.362221, 0.0000, 0.0000, 271.4780);
  390.     CreateObject(3819, 81.249069, 2470.302734, 16.474379, 0.0000, 0.0000, 272.3375);
  391.     CreateObject(3819, 90.062050, 2470.648926, 16.482134, 0.0000, 0.0000, 272.3375);
  392.     CreateObject(3819, 98.845238, 2470.611572, 16.474379, 0.0000, 0.0000, 272.3375);
  393.     CreateObject(3819, 107.795189, 2470.637207, 16.474379, 0.0000, 0.0000, 269.7591);
  394.     CreateObject(3819, 116.599464, 2470.681152, 16.482134, 0.0000, 0.0000, 272.3375);
  395.     CreateObject(982, 113.752930, 2477.199707, 16.175739, 0.0000, 0.0000, 89.3814);
  396.     CreateObject(982, 88.179817, 2477.287109, 16.167931, 0.0000, 0.0000, 90.2409);
  397.     CreateObject(984, 68.976982, 2477.093750, 16.121056, 0.0000, 0.0000, 91.1003);
  398.     CreateObject(983, 59.388790, 2476.917969, 16.167931, 0.0000, 0.0000, 91.1003);
  399.     CreateObject(983, 55.402565, 2476.843262, 16.167931, 0.0000, 0.0000, 91.1003);
  400.     footballdoor=CreateObject(983, 60.101212, 2467.846924, 17.535154, 270.6186, 0.0000, 86.8031);
  401.     CreateObject(987, 41.799297, 2524.785156, 15.492184, 0.0000, 0.0000, 0.0000);
  402.     CreateObject(987, 53.790485, 2524.725098, 15.442184, 0.0000, 0.0000, 0.0000);
  403.     CreateObject(987, 65.739326, 2524.610352, 15.484375, 0.0000, 0.0000, 0.0000);
  404.     CreateObject(987, 77.635735, 2524.633789, 15.484375, 0.0000, 0.0000, 0.0000);
  405.     CreateObject(987, 89.466240, 2524.456787, 15.452545, 0.0000, 0.0000, 0.0000);
  406.     CreateObject(987, 101.331963, 2524.197510, 15.671379, 0.0000, 0.0000, 0.0000);
  407.     CreateObject(987, 113.148247, 2524.337891, 15.758759, 0.0000, 0.0000, 356.5623);
  408.  
  409.  
  410.     football=CreateObject(1598, 89.615692, 2500.632324, 15.789375, 0.0000, 0.0000, 0.0000);
  411.  
  412.     Textdraw0 = TextDrawCreate(107.000000,161.000000,">>S.Paulo (/spaulo)");
  413.     Textdraw1 = TextDrawCreate(105.000000,240.000000,">>Corinthias (/corinthias)");
  414.     TextDrawAlignment(Textdraw0,0);
  415.     TextDrawAlignment(Textdraw1,0);
  416.     TextDrawBackgroundColor(Textdraw0,0x000000ff);
  417.     TextDrawBackgroundColor(Textdraw1,0x000000ff);
  418.     TextDrawFont(Textdraw0,3);
  419.     TextDrawLetterSize(Textdraw0,1.000000,2.799999);
  420.     TextDrawFont(Textdraw1,3);
  421.     TextDrawLetterSize(Textdraw1,1.000000,3.099998);
  422.     TextDrawColor(Textdraw0,0x0000ffff);
  423.     TextDrawColor(Textdraw1,0xff0000ff);
  424.     TextDrawSetOutline(Textdraw0,1);
  425.     TextDrawSetOutline(Textdraw1,1);
  426.     TextDrawSetProportional(Textdraw0,1);
  427.     TextDrawSetProportional(Textdraw1,1);
  428.     TextDrawSetShadow(Textdraw0,1);
  429.     TextDrawSetShadow(Textdraw1,1);
  430.     return 1;
  431. }
  432.  
  433. public OnGameModeExit()
  434. {
  435.     return 1;
  436. }
  437.  
  438. public OnPlayerRequestClass(playerid, classid)
  439. {
  440.     if(teamselected[playerid] == 1)
  441.     {
  442.     SpawnPlayer(playerid);
  443.     SetCameraBehindPlayer(playerid);
  444.     }
  445.     if(spectator[playerid] == 1)
  446.     {
  447.     SpawnPlayer(playerid);
  448.     SetCameraBehindPlayer(playerid);
  449.     }
  450.     return 0;
  451. }
  452.  
  453. public OnPlayerRequestSpawn(playerid)
  454. {
  455.     return 1;
  456. }
  457.  
  458. public OnPlayerConnect(playerid)
  459. {
  460.     ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
  461.     //player connected message
  462.     new pName[MAX_PLAYER_NAME];
  463.     new wstring[128];
  464.     GetPlayerName(playerid, pName, sizeof(pName));
  465.     format(wstring, sizeof(wstring), "%s entrou no server !", pName);
  466.     SendClientMessageToAll(COLOR_WHITE, wstring);
  467.    
  468.     SendClientMessage(playerid,COLOR_YELLOW,"Bem-Vindo ao Brasil Footbal Champions");
  469.     SendClientMessage(playerid,COLOR_LIGHTBLUE,"Quer Jogar? /corinthias ou /spaulo");
  470.     SendClientMessage(playerid,COLOR_LIGHTBLUE,"Que assistir? /espetador");
  471.    
  472.     spectator[playerid]=0;
  473.     playingfootball[playerid]=0;
  474.     matchstarted[playerid]=0;
  475.     teamselected[playerid]=0;
  476.     logged[playerid]=0;
  477.     TextDrawShowForPlayer(playerid,Text:Textdraw0);//Corinthias textdraw
  478.     TextDrawShowForPlayer(playerid,Text:Textdraw1);//S.Paulo textdraw
  479.     TextDrawShowForPlayer(playerid,Text:Textdraw3);//Corinthias textdraw
  480.     TextDrawShowForPlayer(playerid,Text:Textdraw4);//S.Paulo textdraw
  481.    
  482.     if (udb_Exists(PlayerName(playerid)) == 0)
  483.     {
  484.     SendClientMessage(playerid, COLOR_GREEN, "Tu ainda não estas registrado !");
  485.     }
  486.     if (udb_Exists(PlayerName(playerid)) == 1)
  487.     {
  488.     SendClientMessage(playerid, COLOR_GREEN, "Digite /login [PASSWORD]");
  489.     }
  490.     return 1;
  491. }
  492.  
  493. public OnPlayerDisconnect(playerid, reason)
  494. {
  495.     if(logged[playerid] == 1)
  496.     {
  497.     dUserSetINT(PlayerName(playerid)).("goalsscored", GetPlayerScore(playerid));
  498.     }
  499.     new pName[MAX_PLAYER_NAME];
  500.     new string[56];
  501.     GetPlayerName(playerid, pName, sizeof(pName));
  502.     logged[playerid]=0;
  503.    
  504.     switch(reason)
  505.     {
  506.         case 0: format(string, sizeof(string), "%s saiu do servidor [Vontade própria]", pName);
  507.         case 1: format(string, sizeof(string), "%s has left the server. [CRASH]", pName);
  508.         case 2: format(string, sizeof(string), "%s has left the server. [Kickado/Banido]", pName);
  509.     }
  510.  
  511.     SendClientMessageToAll(COLOR_WHITE, string);
  512.     return 1;
  513. }
  514.  
  515. public OnPlayerSpawn(playerid)
  516. {
  517.     TextDrawHideForPlayer(playerid,Text:Textdraw0);//Corinthias Textdraw
  518.     TextDrawHideForPlayer(playerid,Text:Textdraw1);//S.Paulo Textdraw
  519.     return 1;
  520. }
  521.  
  522. public OnPlayerDeath(playerid, killerid, reason)
  523. {
  524.     return 1;
  525. }
  526.  
  527. public OnVehicleSpawn(vehicleid)
  528. {
  529.     return 1;
  530. }
  531.  
  532. public OnVehicleDeath(vehicleid, killerid)
  533. {
  534.     return 1;
  535. }
  536.  
  537. public OnPlayerText(playerid, text[])
  538. {
  539.     if(logged[playerid] == 0)
  540.     {
  541.     SendClientMessage(playerid,COLOR_YELLOW,"Precisas de te logar !");
  542.     return 0;
  543.     }
  544.     return 1;
  545. }
  546.  
  547. public OnPlayerPrivmsg(playerid, recieverid, text[])
  548. {
  549.     return 1;
  550. }
  551.  
  552. public OnPlayerCommandText(playerid, cmdtext[])
  553. {
  554.     new string[256];
  555.     new giveplayer[MAX_PLAYER_NAME];
  556.     new cmd[256];
  557.     new tmp[256];
  558.     new idx;
  559.     new giveplayerid;
  560.    
  561.     cmd = strtok(cmdtext, idx);
  562. //-------------------------------------------------("DUDB")-------------------------------------------------
  563.     if (strcmp(cmd, "/login", true) == 0)
  564.     {
  565.         if (dUserINT(PlayerName(playerid)).("banned") == 1)
  566.         {
  567.         new pName[MAX_PLAYER_NAME];
  568.         new string1[128];
  569.         GetPlayerName(playerid, pName, sizeof(pName));
  570.         format(string1, sizeof(string1), "%s foi kickado. Motivo: Conda Banida.", pName);
  571.         SendClientMessageToAll(COLOR_RED, string1);
  572.         Kick(playerid);
  573.         }
  574.         else if (logged[playerid] != 1 && udb_Exists(PlayerName(playerid)))
  575.         {
  576.             new dir[256];
  577.             dir = strtok(cmdtext, idx);
  578.             if (strlen(dir) && strcmp(dir, dUser(PlayerName(playerid)).("password"), true) == 0)
  579.         {
  580.             logged[playerid] = 1;
  581.             new score = dUserINT(PlayerName(playerid)).("goalsscored");
  582.             SetPlayerScore(playerid,score);
  583.  
  584.             SendClientMessage(playerid, COLOR_RED, "------- Login Completo ---------");
  585.         }
  586.     }
  587.         else SendClientMessage(playerid, COLOR_RED, "ERRO ----------------- LOGIN");
  588.         return 1;
  589.     }
  590.  
  591.  
  592.     if (strcmp(cmd, "/registar", true) == 0)
  593.     {
  594.     if (logged[playerid] != 1 && !udb_Exists(PlayerName(playerid)))
  595.             {
  596.             new dir[256];
  597.             dir = strtok(cmdtext, idx);
  598.             if (strlen(dir))
  599.         {
  600.             new fname[MAX_STRING];
  601.             format(fname,sizeof(fname),"%s.ini",udb_encode(PlayerName(playerid)));
  602.             dini_Create(fname);
  603.             dUserSet(PlayerName(playerid)).("password", dir);
  604.             dUserSet(PlayerName(playerid)).("admin", "0");
  605.             dUserSet(PlayerName(playerid)).("banned", "0");
  606.             dUserSet(PlayerName(playerid)).("owngoals", "0");
  607.             dUserSet(PlayerName(playerid)).("goalsscored", "0");
  608.             dUserSet(PlayerName(playerid)).("gamesplayed", "0");
  609.             SendClientMessage(playerid, COLOR_RED, "Estás registrado. Digita /login para te logares !");
  610.         }
  611.     }
  612.     return 1;
  613.     }
  614.     if (strcmp(cmdtext, "/comecou", true)==0)
  615.     {
  616.         if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  617.         {
  618.         light1=CreateObject( 354, 2001.195679, 1547.113892, 14.283400, 0, 0, 96 );
  619.         light2=CreateObject( 354, 2001.195679, 1547.113892, 14.283400, 0, 0, 96 );
  620.         light3=CreateObject( 354, 2001.195679, 1547.113892, 14.283400, 0, 0, 96 );
  621.         light4=CreateObject( 354, 2001.195679, 1547.113892, 14.283400, 0, 0, 96 );
  622.         light5=CreateObject( 354, 2001.195679, 1547.113892, 14.283400, 0, 0, 96 );
  623.         AttachObjectToPlayer( light1, playerid, 0, 0, 0, 0, 0, 0 );
  624.         AttachObjectToPlayer( light2, playerid, 0, 0, 0, 0, 0, 0 );
  625.         AttachObjectToPlayer( light3, playerid, 0, 0, 0, 0, 0, 0 );
  626.         AttachObjectToPlayer( light4, playerid, 0, 0, 0, 0, 0, 0 );
  627.         AttachObjectToPlayer( light5, playerid, 0, 0, 0, 0, 0, 0 );
  628.         }
  629.         return 1;
  630.     }
  631.     if (strcmp(cmdtext, "/acabou", true)==0)
  632.     {
  633.         if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  634.         {
  635.         DestroyObject(light1);
  636.         DestroyObject(light2);
  637.         DestroyObject(light3);
  638.         DestroyObject(light4);
  639.         DestroyObject(light5);
  640.         return 1;
  641.         }
  642.     }
  643.     if (strcmp(cmdtext, "/escolherequipa", true)==0)
  644.     {
  645.         if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  646.         {
  647.         teamselected[playerid]=0;
  648.         return 1;
  649.         }
  650.     }
  651.     if (strcmp(cmdtext, "/espetador", true)==0)
  652.     {
  653.         if(teamselected[playerid] == 0)
  654.         {
  655.         SetSpawnInfo( playerid, 0, 124,83.8987,2473.4163,16.4844, 0.0, 0, 0, 0, 0, 0, 0 );
  656.         SetPlayerSkin(playerid,124);
  657.         SetPlayerColor(playerid,COLOR_WHITE);
  658.         SpawnPlayer(playerid);
  659.         teamselected[playerid]=0;
  660.         playingfootball[playerid]=0;
  661.         return 1;
  662.         }
  663.         SendClientMessage(playerid,COLOR_YELLOW,"Ja escolheste ser espetador!");
  664.         return 1;
  665.     }
  666.     if (strcmp(cmdtext, "/spaulo", true)==0)
  667.     {
  668.         if(teamselected[playerid] == 0)
  669.         {
  670.         SetSpawnInfo( playerid, 0, 81, 124.6489,2488.8911,16.4922, 0.0, 0, 0, 0, 0, 0, 0 );
  671.         SetPlayerSkin(playerid,81);
  672.         SetPlayerColor(playerid,COLOR_LIGHTBLUE);
  673.         SpawnPlayer(playerid);
  674.         teamselected[playerid]=1;
  675.         playingfootball[playerid]=1;
  676.         SetTimerEx("KeyChanges", 100, 1, "i", playerid);
  677.         gTeam[playerid] = TEAM_BLUE;
  678.         return 1;
  679.         }
  680.         SendClientMessage(playerid,COLOR_YELLOW,"Ja és desta equipa !");
  681.         return 1;
  682.     }
  683.     if (strcmp(cmdtext, "/corinthias", true)==0)
  684.     {
  685.         if(teamselected[playerid] == 0)
  686.         {
  687.         SetSpawnInfo( playerid, 0, 80, 45.6425,2490.3450,16.4844, 0.0, 0, 0, 0, 0, 0, 0 );
  688.         SetPlayerSkin(playerid,80);
  689.         SpawnPlayer(playerid);
  690.         SetPlayerColor(playerid,COLOR_RED);
  691.         teamselected[playerid]=1;
  692.         playingfootball[playerid]=1;
  693.         SetTimerEx("KeyChanges", 100, 1, "i", playerid);
  694.         gTeam[playerid] = TEAM_RED;
  695.         return 1;
  696.         }
  697.         SendClientMessage(playerid,COLOR_YELLOW,"Já és desta equipa");
  698.         return 1;
  699.     }
  700.     if (strcmp(cmdtext, "/respawnbola", true)==0)
  701.     {
  702.         if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  703.         {
  704.         DestroyObject(football);
  705.         football=CreateObject(1598, 89.615692, 2500.632324, 15.789375, 0.0000, 0.0000, 0.0000);
  706.         return 1;
  707.         }
  708.     }
  709.     if (strcmp(cmdtext, "/abrir", true)==0)
  710.     {
  711.         if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  712.         {
  713.         MoveObject(footballdoor,60.101212, 2467.846924, 9.535154, 5.0);
  714.         return 1;
  715.         }
  716.     }
  717.     if (strcmp(cmdtext, "/fechar", true)==0)
  718.     {
  719.         if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  720.         {
  721.         MoveObject(footballdoor,60.101212, 2467.846924, 17.535154,5.0);
  722.         return 1;
  723.         }
  724.     }
  725.     if (strcmp(cmdtext, "/comandos", true)==0)
  726.     {
  727.     SendClientMessage(playerid,COLOR_YELLOW,"><><><Comandos><><><");
  728.     SendClientMessage(playerid,COLOR_OOC,"Geral: /pontuacoes | /parajogar | /objetivo | /admins");
  729.     SendClientMessage(playerid,COLOR_OOC,"Registrar-se ou Logar-se: /registrar | /login");
  730.     return 1;
  731.     }
  732. if(strcmp(cmd, "/slap", true) == 0)
  733. {
  734. new Float:pX,Float:pY,Float:pZ;
  735.         if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  736.     {
  737.     tmp = strtok(cmdtext, idx);
  738.         if(!strlen(tmp))
  739.         {
  740.             SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /slap [playerid]");
  741.             SendClientMessage(playerid, COLOR_YELLOW, "FUNCTION: Will slap the specified player(He will teleport 5 meters higher)");
  742.             return 1;
  743.         }
  744.  
  745.         giveplayerid = ReturnUser(tmp);
  746.         if(giveplayerid != INVALID_PLAYER_ID)
  747.         {
  748.             GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  749.             GetPlayerName(playerid, sendername, sizeof(sendername));
  750.             GetPlayerPos(giveplayerid,pX,pY,pZ);
  751.             SetPlayerPos(giveplayerid,pX,pY,pZ+5);
  752.             printf("[ADMIN NEWS]: Admin %s slapped %s.", sendername, giveplayer);
  753.             format(string, sizeof(string), "Administrador %s slapped %s ",sendername, giveplayer);
  754.             SendClientMessageToAdmins(COLOR_RED,string,1);
  755.         }
  756.         else if(giveplayerid == INVALID_PLAYER_ID)
  757.         {
  758.             format(string, sizeof(string), "%d não está online.", giveplayerid);
  759.             SendClientMessage(playerid, COLOR_RED, string);
  760.         }
  761.     }
  762.     else
  763.     {
  764.     SendClientMessage(playerid, COLOR_RED, "Não és admin ou não tens o nivel necessário !");
  765.     }
  766.     return 1;
  767.     }
  768.     if (strcmp(cmd, "/admins", true) == 0)
  769.     {
  770.         SendClientMessage(playerid, COLOR_GREEN, "Admins Online:");
  771.         for(new i = 0; i < MAX_PLAYERS; i++)
  772.         {
  773.             if (IsPlayerConnected(i))
  774.             {
  775.                 if(dUserINT(PlayerName(i)).("admin") >= 1 && dUserINT(PlayerName(i)).("admin") <= 6)
  776.                     {
  777.                         GetPlayerName(i, player, sizeof(player));
  778.                         format(string, 256, "[Nome: %s] [Nivel %d] [ID:%i]", player,dUserINT(PlayerName(i)).("admin"),i);
  779.                         SendClientMessage(playerid, COLOR_YELLOW, string);
  780.                     }
  781.             }
  782.         }
  783.         SendClientMessage(playerid, COLOR_GREEN, "");
  784.         return 1;
  785.     }
  786.     if (strcmp(cmdtext, "/aa", true)==0)
  787.     {
  788.         if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  789.         {
  790.         SendClientMessage(playerid,COLOR_YELLOW,"[ A D M I N I S T R A T O R ]");
  791.         SendClientMessage(playerid,COLOR_GREY,"Administrador: /abrir - /fechar - /comecou - /acabou - /escolherequipa");
  792.         SendClientMessage(playerid,COLOR_GREY,"Administrador: /ban - /kick - /ir - /trazer - // (ADMIN CHAT)");
  793.         SendClientMessage(playerid,COLOR_GREY,"Administrador: /disarm - /slap - /gmx - /nuke - /congelar - /unfreeze - /daradmin");
  794.         SendClientMessage(playerid,COLOR_GREY,"Administrador: /v - /skin - /giveweapon - /respawnball");
  795.         return 1;
  796.         }
  797.     return 1;
  798.     }
  799.     if (strcmp(cmdtext, "/objective", true)==0)
  800.     {
  801.         SendClientMessage(playerid,COLOR_YELLOW,"Objective: The object of this gamemode is to get 12 goals before the opposite team does.");
  802.         return 1;
  803.     }
  804.     if(strcmp(cmd, "/giveweapon", true) == 0)
  805.     {
  806.     if (dUserINT(PlayerName(playerid)).("admin") >= 2)
  807.         {
  808.             tmp = strtok(cmdtext, idx);
  809.             if(!strlen(tmp))
  810.             {
  811.                 SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /giveweapon [playerid] [weaponid] [ammo]");
  812.                 return 1;
  813.             }
  814.             new gun;
  815.             new ammo;
  816.             giveplayerid = ReturnUser(tmp);
  817.             tmp = strtok(cmdtext, idx);
  818.             gun = strval(tmp);
  819.             if(!strlen(tmp))
  820.             {
  821.                 SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /giveweapon [playerid] [weaponid] [ammo]");
  822.                 return 1;
  823.             }
  824.             tmp = strtok(cmdtext, idx);
  825.             ammo = strval(tmp);
  826.             if(ammo <1||ammo > 10000)
  827.             { SendClientMessage(playerid, COLOR_RED, "You can only give a maximum capacity of 10 000 bullets and not less than 1."); return 1; }
  828.                 if(giveplayerid != INVALID_PLAYER_ID)
  829.                 {
  830.                     GetPlayerName(playerid, sendername, sizeof(sendername));
  831.                     GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  832.                     GivePlayerWeapon(giveplayerid, gun, ammo);
  833.                     format(string, sizeof(string), " Administrador %s gave a weapon to %s ",sendername, giveplayer);
  834.                     SendClientMessageToAdmins(COLOR_RED,string,1);
  835.                 }
  836.                 else if(giveplayerid == INVALID_PLAYER_ID)
  837.                 {
  838.                     format(string, sizeof(string), "%d não está online.", giveplayerid);
  839.                     SendClientMessage(playerid, COLOR_RED, string);
  840.                 }
  841.         }
  842.         else
  843.         {
  844.             SendClientMessage(playerid, COLOR_RED, "You are not an admin with the required level!");
  845.         }
  846.         return 1;
  847.     }
  848.     if(!strcmp(cmd, "/skin", true))
  849.     {
  850.     if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  851.         {
  852.         StrVar = strtok(cmdtext, idx);
  853.         if (!strlen(StrVar)) return SendClientMessage(playerid, COLOR_BAD, "[USAGE]: '/skin [Skinid]");
  854.         if ((strval(StrVar) < 0) || (strval(StrVar) > 299) || IsInvalidSkin(strval(StrVar))) return SendClientMessage(playerid, COLOR_BAD, "[ERROR]: Invalid Skinid");
  855.         SetPlayerSkin(playerid, strval(StrVar));
  856.         format(StrVar, sizeof(StrVar), "[SUCCESS]: Skin changed to skindid %d", GetPlayerSkin(playerid));
  857.         SendClientMessage(playerid, COLOR_GOOD, StrVar);
  858.         return 1;
  859.         }
  860.     }
  861.     if(strcmp(cmd, "/v", true) == 0)
  862.     {
  863.         if (dUserINT(PlayerName(playerid)).("admin") == 0) return SendClientMessage(playerid, l_red, "You are not an Administrador!");
  864.  
  865.         new String[200];
  866.         new Float:x, Float:y, Float:z;
  867.         tmp = strtok(cmdtext, idx);
  868.         if(!strlen(tmp)) return SendClientMessage(playerid, l_red, "You didn't give a vehicle name");
  869.  
  870.         new vehicle = GetVehicleModelIDFromName(tmp);
  871.  
  872.         if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, l_red, "That vehicle name was not found");
  873.  
  874.         new Float:a;
  875.         GetPlayerFacingAngle(playerid, a);
  876.         GetPlayerPos(playerid, x, y, z);
  877.  
  878.         if(IsPlayerInAnyVehicle(playerid) == 1)
  879.         {
  880.             GetXYInFrontOfPlayer(playerid, x, y, 8);
  881.         }
  882.         else
  883.         {
  884.             GetXYInFrontOfPlayer(playerid, x, y, 5);
  885.         }
  886.  
  887.         new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
  888.         LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
  889.  
  890.         format(String, sizeof(String), "You have spawned a %s", aVehicleNames[vehicle - 400]);
  891.         SendClientMessage(playerid, l_green, String);
  892.         return 1;
  893.     }
  894. if(strcmp(cmd, "/congelar", true) == 0)
  895. {
  896. new reason[64];
  897.     if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  898.     {
  899.     tmp = strtok(cmdtext, idx);
  900.         if(!strlen(tmp))
  901.         {
  902.             SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /congelar [playerid] [reason]");
  903.             SendClientMessage(playerid, COLOR_YELLOW, "FUNCTION: Will freeze the specified player. **PLEASE ENTER THE ID ONLY!**");
  904.             return 1;
  905.         }
  906.  
  907.         giveplayerid = ReturnUser(tmp);
  908.         if(giveplayerid != INVALID_PLAYER_ID)
  909.         {
  910.             GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  911.             GetPlayerName(playerid, sendername, sizeof(sendername));
  912.             new length = strlen(cmdtext);
  913.             while ((idx < length) && (cmdtext[idx] <= ' '))
  914.             {
  915.                 idx++;
  916.             }
  917.             new offset = idx;
  918.             while ((idx < length) && ((idx - offset) < (sizeof(reason) - 1)))
  919.             {
  920.                 reason[idx - offset] = cmdtext[idx];
  921.                 idx++;
  922.             }
  923.             reason[idx - offset] = EOS;
  924.             if(!strlen(reason))
  925.                 {
  926.                     SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /congelar [playerid] [reason]");
  927.                     return 1;
  928.                 }
  929.             else
  930.             {
  931.             printf("[ADMIN NEWS]: Admin %s froze %s. Reason: %s", sendername, giveplayer, reason);
  932.             format(string, sizeof(string), " Administrador %s congelou %s. [Motivo: %s ]", sendername,giveplayer,reason);
  933.             SendClientMessageToAdmins(COLOR_RED, string,1);
  934.             TogglePlayerControllable(giveplayerid,0);
  935.             }
  936.         }
  937.  
  938.         else if(giveplayerid == INVALID_PLAYER_ID)
  939.         {
  940.             format(string, sizeof(string), "%d não está online", giveplayerid);
  941.             SendClientMessage(playerid, COLOR_RED, string);
  942.         }
  943.     }
  944.     else
  945.     {
  946.     SendClientMessage(playerid, COLOR_RED, "Não és admin ou não tens o nivel necessário !");
  947.     }
  948.     return 1;
  949. }
  950. if(strcmp(cmd, "/descongelar", true) == 0)
  951. {
  952.     if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  953.     {
  954.     tmp = strtok(cmdtext, idx);
  955.         if(!strlen(tmp))
  956.         {
  957.             SendClientMessage(playerid, COLOR_YELLOW, "USE: /descongelar [playerid]");
  958.             SendClientMessage(playerid, COLOR_YELLOW, "");
  959.             return 1;
  960.         }
  961.  
  962.         giveplayerid = ReturnUser(tmp);
  963.         if(giveplayerid != INVALID_PLAYER_ID)
  964.         {
  965.             GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  966.             GetPlayerName(playerid, sendername, sizeof(sendername));
  967.             printf("Administrador %s unfroze %s.", sendername, giveplayer);
  968.             format(string, sizeof(string), " Administrador %s descongelou %s ", sendername,giveplayer);
  969.             SendClientMessageToAdmins(COLOR_RED, string,1);
  970.             TogglePlayerControllable(giveplayerid,1);
  971.         }
  972.  
  973.         else if(giveplayerid == INVALID_PLAYER_ID)
  974.         {
  975.             format(string, sizeof(string), "%d não está online.", giveplayerid);
  976.             SendClientMessage(playerid, COLOR_RED, string);
  977.         }
  978.     }
  979.     else
  980.     {
  981.     SendClientMessage(playerid, COLOR_RED, "Não és admin ou não tens o nivel necessário !");
  982.     }
  983.     return 1;
  984. }
  985. if(strcmp(cmd, "/nuke", true) == 0)
  986. {
  987.     if (dUserINT(PlayerName(playerid)).("admin") >= 4)
  988.     {
  989.         tmp = strtok(cmdtext, idx);
  990.         if(!strlen(tmp))
  991.             {
  992.                 SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /nuke [playerid]");
  993.                 SendClientMessage(playerid, COLOR_YELLOW, "FUNCTION: Player will explode.");
  994.                 return 1;
  995.             }
  996.             new Float:X,Float:Y,Float:Z;
  997.             giveplayerid = ReturnUser(tmp);
  998.                 if(IsPlayerConnected(giveplayerid))
  999.                 {
  1000.                         GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  1001.                         GetPlayerName(playerid, player, sizeof(player));
  1002.                         GetPlayerPos(giveplayerid, X,Y,Z);
  1003.                         CreateExplosion(X,Y,Z,2,7.0);
  1004.                         SetPlayerHealth(giveplayerid, 0.0);
  1005.                         format(string, sizeof(string), " Administrador %s nuked %s ",player,giveplayer);
  1006.                         SendClientMessageToAdmins(COLOR_RED, string,1);
  1007.                 }
  1008.                 else if (!IsPlayerConnected(giveplayerid))
  1009.                 {
  1010.                     format(string, sizeof(string), "%d não está online.", giveplayerid);
  1011.                     SendClientMessage(playerid, COLOR_RED, string);
  1012.                 }
  1013.    }
  1014.     else
  1015.     {
  1016.     SendClientMessage(playerid, COLOR_RED, "You're not an admin with the required level.");
  1017.     }
  1018. return 1;
  1019. }
  1020. if(strcmp(cmd, "/gmx", true) == 0)
  1021. {
  1022.     if (dUserINT(PlayerName(playerid)).("admin") >= 4)
  1023.     {
  1024.         GameModeExit();
  1025.     }
  1026.     else
  1027.     {
  1028.     SendClientMessage(playerid, COLOR_RED, "You are not a lead admin!");
  1029.     }
  1030. return 1;
  1031. }
  1032. if(strcmp(cmd, "/admin", true) == 0)
  1033. {
  1034. if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  1035.     {
  1036.         GetPlayerName(playerid, playername, sizeof(playername));
  1037.         new length = strlen(cmdtext);
  1038.         while ((idx < length) && (cmdtext[idx] <= ' '))
  1039.         {
  1040.             idx++;
  1041.         }
  1042.         new offset = idx;
  1043.         new result[256];
  1044.         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  1045.         {
  1046.             result[idx - offset] = cmdtext[idx];
  1047.             idx++;
  1048.         }
  1049.         result[idx - offset] = EOS;
  1050.         if(!strlen(result))
  1051.         {
  1052.             SendClientMessage(playerid, COLOR_YELLOW, "USAGE: // <text>");
  1053.         }
  1054.             format(string, sizeof(string), "Admin [%i]%s: %s" ,playerid,playername, result);
  1055.             SendClientMessageToAdmins(COLOR_YELLOW,string,1);
  1056.     }
  1057.     else
  1058.     {
  1059.         SendClientMessage(playerid, COLOR_RED, "não és admin !");
  1060.     }
  1061.     return 1;
  1062. }
  1063. if(strcmp(cmd, "/daradmin", true) == 0)
  1064. {
  1065. if (dUserINT(PlayerName(playerid)).("admin") >= 4)
  1066.     {
  1067.     tmp = strtok(cmdtext, idx);
  1068.         if(!strlen(tmp))
  1069.         {
  1070.             SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /daradmin [playerid] [level 1-5]");
  1071.             SendClientMessage(playerid, COLOR_YELLOW, "");
  1072.             return 1;
  1073.         }
  1074.         giveplayerid = ReturnUser(tmp);
  1075.         tmp = strtok(cmdtext, idx);
  1076.         level = strval(tmp);
  1077.         if(giveplayerid != INVALID_PLAYER_ID)
  1078.         {
  1079.                 GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  1080.                 GetPlayerName(playerid, sendername, sizeof(sendername));
  1081.                 dUserSetINT(PlayerName(playerid)).("admin",level);
  1082.                 printf("[ADMIN NEWS]: %s made %s a level %d admin.", sendername, giveplayer, level);
  1083.                 format(string, sizeof(string), "Você deu admin level %d a %s.", level, sendername);
  1084.                 SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
  1085.                 format(string, sizeof(string), "Tu Ganhaste %s level %d admin.", giveplayer,dUserINT(PlayerName(playerid)).("admin"));
  1086.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  1087.         }
  1088.         else if(giveplayerid != INVALID_PLAYER_ID)
  1089.         {
  1090.             format(string, sizeof(string), "%d não esta online .", giveplayerid);
  1091.             SendClientMessage(playerid, COLOR_RED, string);
  1092.         }
  1093.     }
  1094.     else
  1095.     {
  1096.     SendClientMessage(playerid, COLOR_RED, "Não tens poder suficiente");
  1097.     }
  1098. return 1;
  1099. }
  1100.     if (strcmp(cmdtext, "/pontuacoes", true)==0)
  1101.     {
  1102.     new wstring[128];
  1103.     format(wstring, sizeof(wstring), "[Score]Corinthias %d - S.Paulo: %d.", redscore,bluescore);
  1104.     SendClientMessage(playerid,COLOR_OOC, wstring);
  1105.     return 1;
  1106.     }
  1107.     if(strcmp(cmd, "/ban", true) == 0)
  1108. {
  1109. new reason[256];
  1110. if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  1111.     {
  1112.     tmp = strtok(cmdtext, idx);
  1113.         if(!strlen(tmp))
  1114.         {
  1115.             SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ban [playerid] [reason]");
  1116.             SendClientMessage(playerid, COLOR_WHITE, "");
  1117.             return 1;
  1118.   }
  1119.  
  1120.         giveplayerid = ReturnUser(tmp);
  1121.         if(giveplayerid != INVALID_PLAYER_ID)
  1122.         {
  1123.             GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  1124.             GetPlayerName(playerid, sendername, sizeof(sendername));
  1125.             new length = strlen(cmdtext);
  1126.             while ((idx < length) && (cmdtext[idx] <= ' '))
  1127.             {
  1128.                 idx++;
  1129.             }
  1130.             new offset = idx;
  1131.             while ((idx < length) && ((idx - offset) < (sizeof(reason) - 1)))
  1132.             {
  1133.                 reason[idx - offset] = cmdtext[idx];
  1134.                 idx++;
  1135.             }
  1136.             reason[idx - offset] = EOS;
  1137.             if(!strlen(reason))
  1138.                 {
  1139.                     SendClientMessage(playerid, COLOR_YELLOW, "USE: /ban [playerid] [reason]");
  1140.                     return 1;
  1141.                 }
  1142.             else
  1143.             {
  1144.             format(string, sizeof(string), "Admin %s baniu %s - Motivo: %s", sendername,giveplayer,reason);
  1145.             dUserSet(PlayerName(giveplayerid)).("banned", "1");
  1146.             SendClientMessageToAll(COLOR_YELLOW, string);
  1147.             Kick(giveplayerid);
  1148.             }
  1149.         }
  1150.         else if(giveplayerid == INVALID_PLAYER_ID)
  1151.         {
  1152.             format(string, sizeof(string), "%d não está online.", giveplayerid);
  1153.             SendClientMessage(playerid, COLOR_YELLOW, string);
  1154.         }
  1155.     }
  1156.     else
  1157.     {
  1158.     SendClientMessage(playerid, COLOR_YELLOW, "Não tens level suficiente !");
  1159.     }
  1160. return 1;
  1161. }
  1162. if(strcmp(cmd, "/kick", true) == 0)
  1163. {
  1164. new reason[256];
  1165. if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  1166.     {
  1167.     tmp = strtok(cmdtext, idx);
  1168.         if(!strlen(tmp))
  1169.         {
  1170.             SendClientMessage(playerid, COLOR_WHITE, "USE: /kick [playerid] [reason]");
  1171.             SendClientMessage(playerid, COLOR_WHITE, "");
  1172.             return 1;
  1173.   }
  1174.  
  1175.         giveplayerid = ReturnUser(tmp);
  1176.         if(giveplayerid != INVALID_PLAYER_ID)
  1177.         {
  1178.             GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  1179.             GetPlayerName(playerid, sendername, sizeof(sendername));
  1180.             new length = strlen(cmdtext);
  1181.             while ((idx < length) && (cmdtext[idx] <= ' '))
  1182.             {
  1183.                 idx++;
  1184.             }
  1185.             new offset = idx;
  1186.             while ((idx < length) && ((idx - offset) < (sizeof(reason) - 1)))
  1187.             {
  1188.                 reason[idx - offset] = cmdtext[idx];
  1189.                 idx++;
  1190.             }
  1191.             reason[idx - offset] = EOS;
  1192.             if(!strlen(reason))
  1193.                 {
  1194.                     SendClientMessage(playerid, COLOR_YELLOW, "USE: /kick [playerid] [reason]");
  1195.                     return 1;
  1196.                 }
  1197.             else
  1198.             {
  1199.             format(string, sizeof(string), "Admin %s kickou %s - Motivo: %s", sendername,giveplayer,reason);
  1200.             SendClientMessageToAll(COLOR_YELLOW, string);
  1201.             Kick(giveplayerid);
  1202.             }
  1203.         }
  1204.         else if(giveplayerid == INVALID_PLAYER_ID)
  1205.         {
  1206.             format(string, sizeof(string), "%d não está online !", giveplayerid);
  1207.             SendClientMessage(playerid, COLOR_YELLOW, string);
  1208.         }
  1209.     }
  1210.     else
  1211.     {
  1212.     SendClientMessage(playerid, COLOR_YELLOW, "You are not an Administrador or an Administrador with the required level.");
  1213.     }
  1214. return 1;
  1215. }
  1216. if(strcmp(cmd, "/disarm", true) == 0)
  1217. {
  1218. new reason[256];
  1219. if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  1220.     {
  1221.     tmp = strtok(cmdtext, idx);
  1222.         if(!strlen(tmp))
  1223.         {
  1224.             SendClientMessage(playerid, COLOR_WHITE, "USE: /kick [playerid] [reason]");
  1225.             SendClientMessage(playerid, COLOR_WHITE, "");
  1226.             return 1;
  1227.   }
  1228.  
  1229.         giveplayerid = ReturnUser(tmp);
  1230.         if(giveplayerid != INVALID_PLAYER_ID)
  1231.         {
  1232.             GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
  1233.             GetPlayerName(playerid, sendername, sizeof(sendername));
  1234.             new length = strlen(cmdtext);
  1235.             while ((idx < length) && (cmdtext[idx] <= ' '))
  1236.             {
  1237.                 idx++;
  1238.             }
  1239.             new offset = idx;
  1240.             while ((idx < length) && ((idx - offset) < (sizeof(reason) - 1)))
  1241.             {
  1242.                 reason[idx - offset] = cmdtext[idx];
  1243.                 idx++;
  1244.             }
  1245.             reason[idx - offset] = EOS;
  1246.             if(!strlen(reason))
  1247.                 {
  1248.                     SendClientMessage(playerid, COLOR_YELLOW, "USE: /disarm [playerid] [reason]");
  1249.                     return 1;
  1250.                 }
  1251.             else
  1252.             {
  1253.             format(string, sizeof(string), "Admin %s tirou o %s do jogo - Motivo: %s", sendername,giveplayer,reason);
  1254.             SendClientMessageToAll(COLOR_YELLOW, string);
  1255.             ResetPlayerWeapons(giveplayerid);
  1256.             }
  1257.         }
  1258.         else if(giveplayerid == INVALID_PLAYER_ID)
  1259.         {
  1260.             format(string, sizeof(string), "%d não está online !", giveplayerid);
  1261.             SendClientMessage(playerid, COLOR_YELLOW, string);
  1262.         }
  1263.     }
  1264.     else
  1265.     {
  1266.     SendClientMessage(playerid, COLOR_YELLOW, "");
  1267.     }
  1268. return 1;
  1269. }
  1270.     if (strcmp(cmdtext, "/pararjogar", true)==0)
  1271.     {
  1272.         playingfootball[playerid]=0;
  1273.         teamselected[playerid]=0;
  1274.         SendClientMessage(playerid,COLOR_LIGHTBLUE,"You stopped playing football.");
  1275.         SetPlayerHealth(playerid,-1);
  1276.         ForceClassSelection(playerid);
  1277.         TextDrawShowForPlayer(playerid,Text:Textdraw0);//Corinthias textdraw
  1278.         TextDrawShowForPlayer(playerid,Text:Textdraw1);//S.Paulo textdraw
  1279.         return 1;
  1280.     }
  1281. if(strcmp(cmd, "/ir", true) == 0)
  1282. {
  1283. new Float:pX,Float:pY,Float:pZ;
  1284. if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  1285.     {
  1286.     tmp = strtok(cmdtext, idx);
  1287.         if(!strlen(tmp))
  1288.         {
  1289.             SendClientMessage(playerid, COLOR_YELLOW, "Use: [/ir PLAYERID]");
  1290.             SendClientMessage(playerid, COLOR_YELLOW, "");
  1291.             return 1;
  1292.         }
  1293.  
  1294.         giveplayerid = ReturnUser(tmp);
  1295.         if(giveplayerid != INVALID_PLAYER_ID)
  1296.         {
  1297.             if (GetPlayerState(playerid) == 2)
  1298.             {
  1299.             GetPlayerPos(giveplayerid,pX,pY,pZ);
  1300.             SetVehiclePos(GetPlayerVehicleID(playerid),pX,pY,pZ+2);
  1301.             }
  1302.             else
  1303.             {
  1304.             GetPlayerPos(giveplayerid,pX,pY,pZ);
  1305.             SetPlayerPos(playerid,pX,pY,pZ+2);
  1306.             }
  1307.         }
  1308.         else if(giveplayerid == INVALID_PLAYER_ID)
  1309.         {
  1310.             format(string, sizeof(string), "%d não é um player ativo !", giveplayerid);
  1311.             SendClientMessage(playerid, COLOR_RED, string);
  1312.         }
  1313.     }
  1314.     else
  1315.     {
  1316.     SendClientMessage(playerid, COLOR_RED, "Não és admin ou não tens o nivel necessário !");
  1317.     }
  1318.     return 1;
  1319. }
  1320. if(strcmp(cmd, "/trazer", true) == 0)
  1321. {
  1322. new Float:pX,Float:pY,Float:pZ;
  1323. if (dUserINT(PlayerName(playerid)).("admin") >= 1)
  1324.     {
  1325.     tmp = strtok(cmdtext, idx);
  1326.         if(!strlen(tmp))
  1327.         {
  1328.             SendClientMessage(playerid, COLOR_YELLOW, "USE: /trazer [playerid]");
  1329.             SendClientMessage(playerid, COLOR_YELLOW, "");
  1330.             return 1;
  1331.         }
  1332.         giveplayerid = ReturnUser(tmp);
  1333.         if(giveplayerid != INVALID_PLAYER_ID)
  1334.         {
  1335.             if (GetPlayerState(giveplayerid) == PLAYER_STATE_DRIVER)
  1336.             {
  1337.             GetPlayerPos(playerid,pX,pY,pZ);
  1338.             SetVehiclePos(GetPlayerVehicleID(giveplayerid),pX,pY,pZ+2);
  1339.             }
  1340.             else
  1341.             {
  1342.             GetPlayerPos(playerid,pX,pY,pZ);
  1343.             SetPlayerPos(giveplayerid,pX,pY,pZ+2);
  1344.             }
  1345.         }
  1346.         else if(giveplayerid == INVALID_PLAYER_ID)
  1347.         {
  1348.             format(string, sizeof(string), "%d não está online.", giveplayerid);
  1349.             SendClientMessage(playerid, COLOR_RED, string);
  1350.         }
  1351.     }
  1352.     else
  1353.     {
  1354.     SendClientMessage(playerid, COLOR_RED, "Não és admin ou não tens o nivel necessário !");
  1355.     }
  1356.     return 1;
  1357. }
  1358.     return 0;
  1359. }
  1360.  
  1361. public OnPlayerInfoChange(playerid)
  1362. {
  1363.     return 1;
  1364. }
  1365.  
  1366. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  1367. {
  1368.     return 1;
  1369. }
  1370.  
  1371. public OnPlayerExitVehicle(playerid, vehicleid)
  1372. {
  1373.     return 1;
  1374. }
  1375.  
  1376. public OnPlayerStateChange(playerid, newstate, oldstate)
  1377. {
  1378.     return 1;
  1379. }
  1380.  
  1381. public OnPlayerEnterCheckpoint(playerid)
  1382. {
  1383.     return 1;
  1384. }
  1385.  
  1386. public OnPlayerLeaveCheckpoint(playerid)
  1387. {
  1388.     return 1;
  1389. }
  1390.  
  1391. public OnPlayerEnterRaceCheckpoint(playerid)
  1392. {
  1393.     return 1;
  1394. }
  1395.  
  1396. public OnPlayerLeaveRaceCheckpoint(playerid)
  1397. {
  1398.     return 1;
  1399. }
  1400.  
  1401. public OnRconCommand(cmd[])
  1402. {
  1403.     return 1;
  1404. }
  1405.  
  1406. public OnObjectMoved(objectid)
  1407. {
  1408.     return 1;
  1409. }
  1410.  
  1411. public OnPlayerObjectMoved(playerid, objectid)
  1412. {
  1413.     return 1;
  1414. }
  1415.  
  1416. public OnPlayerPickUpPickup(playerid, pickupid)
  1417. {
  1418.     return 1;
  1419. }
  1420.  
  1421. public OnPlayerSelectedMenuRow(playerid, row)
  1422. {
  1423.     return 1;
  1424. }
  1425.  
  1426. public OnPlayerExitedMenu(playerid)
  1427. {
  1428.     return 1;
  1429. }
  1430. GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
  1431. {
  1432.     new Float:a;
  1433.     GetPlayerPos(playerid, x, y, a);
  1434.     GetPlayerFacingAngle(playerid, a);
  1435.     if (GetPlayerVehicleID(playerid))
  1436.     {
  1437.         GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  1438.     }
  1439.     x += (distance * floatsin(-a, degrees));
  1440.     y += (distance * floatcos(-a, degrees));
  1441. }
  1442. public KeyChanges()
  1443. {
  1444.     new keys, updown, leftright;
  1445.     for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
  1446.     {
  1447.         if(IsPlayerConnected(playerid))
  1448.         {
  1449.     GetPlayerKeys(playerid, keys, updown, leftright);
  1450.  
  1451.     new Float:ox, Float:oy, Float:oz;
  1452.     GetObjectPos(football, ox, oy, oz);
  1453.  
  1454.     new Float:px, Float:py, Float:pz;
  1455.  
  1456.     new Float:angle;
  1457.     GetPlayerFacingAngle(playerid, angle);
  1458.    
  1459.  
  1460.             if(keys == KEY_HANDBRAKE && playingfootball[playerid] == 1)
  1461.             {
  1462.            
  1463.                 if(PlayerToPoint(1.7,playerid,ox,oy,oz))
  1464.                 {
  1465.                 new pName[MAX_PLAYER_NAME];
  1466.                 GetPlayerName(playerid, pName, sizeof(pName));
  1467.                 format(lastentered, sizeof(lastentered), "%s", pName);
  1468.                
  1469.                 GetPlayerPos(playerid, px, py, pz);
  1470.                 GetXYInFrontOfPlayer(playerid, px, py, 7.0);
  1471.                 MoveObject(football,px,py,15.789375,10.0);
  1472.                 PlayerPlaySound(playerid,1130,0.0,0.0,0.0);
  1473.                 ApplyAnimation(playerid,"FIGHT_D","FightD_1",4.1,0,1,1,0,0);
  1474.                 }
  1475.             }
  1476.             else if(keys == KEY_HANDBRAKE + KEY_SPRINT && playingfootball[playerid] == 1)
  1477.             {
  1478.  
  1479.                 if(PlayerToPoint(1.7,playerid,ox,oy,oz))
  1480.                 {
  1481.                 new pName[MAX_PLAYER_NAME];
  1482.                 GetPlayerName(playerid, pName, sizeof(pName));
  1483.                 format(lastentered, sizeof(lastentered), "%s", pName);
  1484.  
  1485.                 GetPlayerPos(playerid, px, py, pz);
  1486.                 GetXYInFrontOfPlayer(playerid, px, py, 7.0);
  1487.                 MoveObject(football,px,py,15.789375,10.0);
  1488.                 PlayerPlaySound(playerid,1130,0.0,0.0,0.0);
  1489.                 ApplyAnimation(playerid,"FIGHT_D","FightD_1",4.1,0,1,1,0,0);
  1490.                 }
  1491.             }
  1492.         }
  1493.     }
  1494. }
  1495.  
  1496. public IsAGoal()
  1497. {
  1498.     for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
  1499.     {
  1500.     if(IsPlayerConnected(playerid))
  1501.     {
  1502.     new string1[128];
  1503.     format(string1, sizeof(string1), "Corinthias: %d", redscore);
  1504.     TextDrawSetString(Text:Textdraw3,string1);
  1505.  
  1506.     new string2[128];
  1507.     format(string2, sizeof(string2), "S.Paulo: %d", bluescore);
  1508.     TextDrawSetString(Text:Textdraw4,string2);
  1509.    
  1510.     new Float:fx, Float:fy, Float:fz;
  1511.     GetObjectPos(football, fx, fy, fz);
  1512.     new enteredid = GetLastEnteredID(lastentered);
  1513.  
  1514.     SetPlayerMapIcon( playerid, 0, fx, fy, fz, 56, 0 );//ball icon
  1515.  
  1516.  
  1517.             if(bluescore >= 12)
  1518.             {
  1519.             for(new i = 0; i < MAX_PLAYERS; i++)
  1520.             {
  1521.             SendClientMessageToAll(COLOR_GREEN,"[Vitória] S.Paulo GANHOU !");
  1522.             bluescore = 0;
  1523.             redscore = 0;
  1524.             SetTimerEx("SpawnMe", 15000, 0, "i", i);
  1525.             SendClientMessageToAll(COLOR_WHITE,"[Server] um novo jogo começará daqui a 15 segundos !");
  1526.             ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
  1527.             TogglePlayerControllable(i,0);
  1528.            
  1529.             if(gTeam[i] == TEAM_BLUE)
  1530.             {
  1531.             SetPlayerSpecialAction(i,SPECIAL_ACTION_DANCE3);
  1532.             }
  1533.             return 1;
  1534.             }
  1535.             }
  1536.             if(redscore >= 12)
  1537.             {
  1538.             for(new i = 0; i < MAX_PLAYERS; i++)
  1539.             {
  1540.             SendClientMessageToAll(COLOR_GREEN,"[Vitória] O Corinthias Ganhou !");
  1541.             SetTimerEx("SpawnMe", 15000, 0, "i", i);
  1542.             SendClientMessageToAll(COLOR_WHITE,"[Server] Um Novo jogo começará em 15 segundos !");
  1543.             bluescore = 0;
  1544.             redscore = 0;
  1545.             TogglePlayerControllable(i,0);
  1546.             ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
  1547.            
  1548.             if(gTeam[i] == TEAM_RED)
  1549.             {
  1550.             SetPlayerSpecialAction(i,SPECIAL_ACTION_DANCE3);
  1551.             }
  1552.             return 1;
  1553.             }
  1554.             }
  1555.             if(ObjectToPoint(2.0,football,122.3518,2499.8162,16.4844) && gTeam[enteredid] == TEAM_BLUE)//Net right hand side
  1556.             {
  1557.             new wstring[128];
  1558.             format(wstring, sizeof(wstring), "[S.Paulo] %s marcou um golo na própria baliza, -1 Pointo! ", lastentered);
  1559.             SendClientMessageToAll(COLOR_LIGHTBLUE, wstring);
  1560.            
  1561.             new score = GetPlayerScore(enteredid);
  1562.             SetPlayerScore(enteredid, score-1);
  1563.            
  1564.             bluescore -= 1;
  1565.  
  1566.             DestroyObject(football);
  1567.             football=CreateObject(1598, 89.615692, 2500.632324, 15.789375, 0.0000, 0.0000, 0.0000);
  1568.             }
  1569.             if(ObjectToPoint(2.0,football,44.3105,2502.3252,16.4844) && gTeam[enteredid] == TEAM_BLUE)//Net left hand side
  1570.             {
  1571.             new wstring[128];
  1572.             format(wstring, sizeof(wstring), "[S.Paulo] %s marcou um golo fantástico ao Corinthias !!", lastentered);
  1573.             SendClientMessageToAll(COLOR_LIGHTBLUE, wstring);
  1574.  
  1575.             new score = GetPlayerScore(enteredid);
  1576.             SetPlayerScore(enteredid, score+1);
  1577.  
  1578.             bluescore += 1;
  1579.            
  1580.             DestroyObject(football);
  1581.             football=CreateObject(1598, 89.615692, 2500.632324, 15.789375, 0.0000, 0.0000, 0.0000);
  1582.             }
  1583.            
  1584.             //Corinthias STUFF
  1585.             if(ObjectToPoint(2.0,football,122.3518,2499.8162,16.4844) && gTeam[enteredid] == TEAM_RED)//Net right hand side
  1586.             {
  1587.             new wstring[128];
  1588.             format(wstring, sizeof(wstring), "[Corinthias] %s marcou um golo fantástico ao S.Paulo!", lastentered);
  1589.             SendClientMessageToAll(COLOR_LIGHTBLUE, wstring);
  1590.  
  1591.             new score = GetPlayerScore(enteredid);
  1592.             SetPlayerScore(enteredid, score+1);
  1593.  
  1594.             redscore += 1;
  1595.            
  1596.             DestroyObject(football);
  1597.             football=CreateObject(1598, 89.615692, 2500.632324, 15.789375, 0.0000, 0.0000, 0.0000);
  1598.             }
  1599.             if(ObjectToPoint(2.0,football,44.3105,2502.3252,16.4844) && gTeam[enteredid] == TEAM_RED)//Net left hand side
  1600.             {
  1601.             new wstring[128];
  1602.             format(wstring, sizeof(wstring), "[Corinthias] %s marcou um golo na própria baliza -1Ponto ! ", lastentered);
  1603.             SendClientMessageToAll(COLOR_LIGHTBLUE, wstring);
  1604.  
  1605.             new score = GetPlayerScore(enteredid);
  1606.             SetPlayerScore(enteredid, score-1);
  1607.  
  1608.             redscore -= 1;
  1609.            
  1610.             DestroyObject(football);
  1611.             football=CreateObject(1598, 89.615692, 2500.632324, 15.789375, 0.0000, 0.0000, 0.0000);
  1612.             }
  1613.         }
  1614.     }
  1615.     return 1;
  1616. }
  1617. public SpawnMe(playerid)
  1618. {
  1619.         TogglePlayerControllable(playerid,1);
  1620.         SpawnPlayer(playerid);
  1621.         ClearAnimations(playerid);
  1622.         return 1;
  1623. }
  1624. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  1625. {
  1626.     if(IsPlayerConnected(playerid))
  1627.     {
  1628.         new Float:oldposx, Float:oldposy, Float:oldposz;
  1629.         new Float:tempposx, Float:tempposy, Float:tempposz;
  1630.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  1631.         tempposx = (oldposx -x);
  1632.         tempposy = (oldposy -y);
  1633.         tempposz = (oldposz -z);
  1634.         //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  1635.         if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  1636.         {
  1637.             return 1;
  1638.         }
  1639.     }
  1640.     return 0;
  1641. }
  1642. public ObjectToPoint(Float:radi, objectid, Float:x, Float:y, Float:z)
  1643. {
  1644.         new Float:oldposx, Float:oldposy, Float:oldposz;
  1645.         new Float:tempposx, Float:tempposy, Float:tempposz;
  1646.         GetObjectPos(objectid, oldposx, oldposy, oldposz);
  1647.         tempposx = (oldposx -x);
  1648.         tempposy = (oldposy -y);
  1649.         tempposz = (oldposz -z);
  1650.         //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  1651.         if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  1652.         {
  1653.             return 1;
  1654.         }
  1655.     return 0;
  1656. }
  1657. stock PlayerName(playerid)
  1658. {
  1659.     new name[MAX_PLAYER_NAME];
  1660.     GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  1661.     return name;
  1662. }
  1663. stock GetLastEnteredID(lastentered[])
  1664. {
  1665.     new name[MAX_PLAYER_NAME];
  1666.     for(new i = 0; i < MAX_PLAYERS; i++)
  1667.     {
  1668.         if (IsPlayerConnected(i ))
  1669.         {
  1670.             GetPlayerName(i, name, sizeof(name));
  1671.             if (!strcmp(lastentered, name)) return i;
  1672.         }
  1673.     }
  1674.     return INVALID_PLAYER_ID;
  1675. }
  1676. public SendClientMessageToAdmins(color,const string[],alevel)
  1677. {
  1678.     for(new i = 0; i < MAX_PLAYERS; i++)
  1679.     {
  1680.         if(IsPlayerConnected(i))
  1681.         {
  1682.             if (dUserINT(PlayerName(i)).("admin") >= 1)
  1683.             {
  1684.                 SendClientMessage(i, color, string);
  1685.                 printf("%s", string);
  1686.             }
  1687.         }
  1688.     }
  1689.     return 1;
  1690. }
  1691. GetVehicleModelIDFromName(vname[])
  1692. {
  1693.     for(new i = 0; i < 211; i++)
  1694.     {
  1695.         if(strfind(aVehicleNames[i], vname, true) != -1)
  1696.         return i + 400;
  1697.     }
  1698.     return -1;
  1699. }
  1700. stock IsInvalidSkin(skinid)
  1701. {
  1702.     new InSkin[] = {0, 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208,  273, 289};
  1703.     for (new i=0; i<sizeof(InSkin); i++) if(skinid == InSkin[i]) return 1;
  1704.     return 0;
  1705. }
  1706.  
  1707.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement