Advertisement
Chip7

[GM] Brasil Football Champions

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