#define TEAM_VERMELHO ( 0 ) #define TEAM_VERDE ( 1 ) CMD:avermelho(playerid,params[]) { if(Team[playerid] == TEAM_VERMELHO) { return SendClientMessage(playerid, 0xFF000049, "Voce nao e da Gang VERMELHO"); } else { #pragma unused params GivePlayerWeapon(playerid, 2, 500); GivePlayerWeapon(playerid, 14, 500); GivePlayerWeapon(playerid, 22, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 28, 500); GivePlayerWeapon(playerid, 30, 500); GivePlayerWeapon(playerid, 33, 500); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,0x00FF0096,"Set Armas Adiqueridas"); return 1; } } CMD:averde(playerid,params[]) { if(Team[playerid] == TEAM_VERDE) { return SendClientMessage(playerid, 0xFF000049, "Voce nao e da Gang Verde"); } else { #pragma unused params GivePlayerWeapon(playerid, 2, 500); GivePlayerWeapon(playerid, 14, 500); GivePlayerWeapon(playerid, 22, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 28, 500); GivePlayerWeapon(playerid, 30, 500); GivePlayerWeapon(playerid, 33, 500); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,0x00FF0096,"Set Armas Verdes Adiqueridas"); return 1; } }
CMD:avermelho(playerid,params[])
{
if(Team[playerid] != TEAM_VERMELHO) return SendClientMessage(playerid, 0xFF000049, "Voce nao e da Gang VERMELHO");
#pragma unused params
GivePlayerWeapon(playerid, 2, 500);
GivePlayerWeapon(playerid, 14, 500);
GivePlayerWeapon(playerid, 22, 500);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 28, 500);
GivePlayerWeapon(playerid, 30, 500);
GivePlayerWeapon(playerid, 33, 500);
GivePlayerMoney(playerid,-1000);
SendClientMessage(playerid,0x00FF0096,"Set Armas Adiqueridas");
return 1;
}
Coloque o comando da team azul e ja agora cmd mais fбcil.
pawn Код:
Ajudei ? +REP ae |
new Team[MAX_PLAYERS]; CMD:avermelho(playerid,params[]) { if(Team[playerid] == TEAM_VERMELHO) { return SendClientMessage(playerid, 0xFF000049, "Voce nao e da Gang VERMELHO"); } else { #pragma unused params GivePlayerWeapon(playerid, 2, 500); GivePlayerWeapon(playerid, 14, 500); GivePlayerWeapon(playerid, 22, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 28, 500); GivePlayerWeapon(playerid, 30, 500); GivePlayerWeapon(playerid, 33, 500); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,0x00FF0096,"Set Armas Adiqueridas"); return 1; } } CMD:averde(playerid,params[]) { if(Team[playerid] != TEAM_VERDE) { return SendClientMessage(playerid, 0xFF000049, "Voce nao e da Gang Verde"); } else { #pragma unused params GivePlayerWeapon(playerid, 2, 500); GivePlayerWeapon(playerid, 14, 500); GivePlayerWeapon(playerid, 22, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 28, 500); GivePlayerWeapon(playerid, 30, 500); GivePlayerWeapon(playerid, 33, 500); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,0x00FF0096,"Set Armas Verdes Adiqueridas"); return 1; } } CMD:aazul(playerid,params[]) { if(Team[playerid] != TEAM_AZUL) { return SendClientMessage(playerid, 0xFF000049, "Voce nao e da Gang Azul"); } else { #pragma unused params GivePlayerWeapon(playerid, 2, 500); GivePlayerWeapon(playerid, 14, 500); GivePlayerWeapon(playerid, 22, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 28, 500); GivePlayerWeapon(playerid, 30, 500); GivePlayerWeapon(playerid, 33, 500); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,0x00FF0096,"Set Armas Azul Adiqueridas"); return 1; } }
#include <a_samp> #include <zcmd> #define TEAM_VERMELHO ( 0 ) #define TEAM_VERDE ( 1 ) #define TEAM_AZUL ( 2 ) #define TEAM_LARANJA ( 4 ) new vermelho; new verde; new azul; new laranja; public OnGameModeInit() { AddPlayerClass( 19, -1754.3842, 958.3917, 24.8828, 182.5793, 23, 500, 1, 0, 0, 0 ); // TIME VERMELHO AddPlayerClass( 18, -1754.3842, 958.3917, 24.8828, 182.5793, 23, 500, 1, 0, 0, 0 ); // TIME VERMELHO AddPlayerClass( 22, -1754.3842, 958.3917, 24.8828, 182.5793, 23, 500, 1, 0, 0, 0 ); // TIME VERMELHO AddPlayerClass( 193, -1754.3842, 958.3917, 24.8828, 182.5793, 23, 500, 1, 0, 0, 0 ); // TIME VERMELHO AddPlayerClass( 45, 1958.3783, 1343.1572, 15.3746, 269.1425, 23, 500, 1, 0, 0, 0 ); // TIME VERDE AddPlayerClass( 107, 1958.3783, 1343.1572, 15.3746, 269.1425, 23, 500, 1, 0, 0, 0 ); // TIME VERDE AddPlayerClass( 106, 1958.3783, 1343.1572, 15.3746, 269.1425, 23, 500, 1, 0, 0, 0 ); // TIME VERDE AddPlayerClass( 207, 1958.3783, 1343.1572, 15.3746, 269.1425, 23, 500, 1, 0, 0, 0 ); // TIME VERDE AddPlayerClass( 29, 1129.9064, -1489.3713, 22.7690, 3.5184, 23, 500, 1, 0, 0, 0 ); // TIME AZUL AddPlayerClass( 46, 1129.9064, -1489.3713, 22.7690, 3.5184, 23, 500, 1, 0, 0, 0 ); // TIME AZUL AddPlayerClass( 48, 1129.9064, -1489.3713, 22.7690, 3.5184, 23, 500, 1, 0, 0, 0 ); // TIME AZUL AddPlayerClass( 198, 1129.9064, -1489.3713, 22.7690, 3.5184, 23, 500, 1, 0, 0, 0 ); // TIME AZUL AddPlayerClass( 226, 2407.2432, 91.1346, 26.4744, 98.3893, 23, 500, 1, 0, 0, 0 ); // TIME NADA AddPlayerClass( 230, 2407.2432, 91.1346, 26.4744, 98.3893, 23, 500, 1, 0, 0, 0 ); // TIME NADA AddPlayerClass( 246, 2407.2432, 91.1346, 26.4744, 98.3893, 23, 500, 1, 0, 0, 0 ); // TIME NADA AddPlayerClass( 247, 2407.2432, 91.1346, 26.4744, 98.3893, 23, 500, 1, 0, 0, 0 ); // TIME NADA return 1; } public OnPlayerRequestClass( playerid, classid ) { switch ( classid ) // This is like a if/elseif statement. { case 0: // If the classid is 0 { // Then GameTextForPlayer( playerid, "~r~TEAM VERMELHO", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_VERMELHO ); // Sets the player's team to TEAM_BALLAS } case 1: // If the classid is 1 { // Then GameTextForPlayer( playerid, "~r~TEAM VERMELHO", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_VERMELHO ); // Sets the player's team to TEAM_CJ } case 2: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~r~TEAM VERMELHO", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_VERMELHO ); // Sets the player's team to TEAM_CJ } case 3: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~r~TEAM VERMELHO", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_VERMELHO ); // Sets the player's team to TEAM_CJ } case 4: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~g~TEAM VERDE", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_VERDE ); // Sets the player's team to TEAM_CJ } case 5: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~g~TEAM VERDE", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_VERDE ); // Sets the player's team to TEAM_CJ } case 6: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~g~TEAM VERDE", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_VERDE ); // Sets the player's team to TEAM_CJ } case 7: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~g~TEAM VERDE", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_VERDE ); // Sets the player's team to TEAM_CJ } case 8: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~b~TEAM AZUL", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_AZUL ); // Sets the player's team to TEAM_CJ } case 9: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~b~TEAM AZUL", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_AZUL ); // Sets the player's team to TEAM_CJ } case 10: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~b~TEAM AZUL", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_AZUL ); // Sets the player's team to TEAM_CJ } case 11: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~b~TEAM AZUL", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_AZUL ); // Sets the player's team to TEAM_CJ } case 12: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~y~TEAM LARANJA", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_LARANJA ); // Sets the player's team to TEAM_CJ } case 13: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~y~TEAM LARANJA", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_LARANJA ); // Sets the player's team to TEAM_CJ } case 14: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~y~TEAM LARANJA", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_LARANJA ); // Sets the player's team to TEAM_CJ } case 15: // If the classid is 2 { // Then GameTextForPlayer( playerid, "~y~TEAM LARANJA", 1000, 3 ); SetPlayerPos(playerid, 1176.287,-1994.802,69.00781); SetPlayerFacingAngle(playerid,730); SetPlayerCameraPos(playerid, 1174.287,-1991.802,69.00781); SetPlayerCameraLookAt(playerid, 1176.287,-1994.802,69.00781); SetPlayerTeam( playerid, TEAM_LARANJA ); // Sets the player's team to TEAM_CJ } } return 1; } CMD:mudar(playerid) { ForceClassSelection(playerid); SetPlayerHealth(playerid, 0.00); SendClientMessage(playerid, 0x33AA33AA,"Mudando de TIME!"); return 1; } new Team[MAX_PLAYERS]; CMD:avermelho(playerid,params[]) { if(Team[playerid] != TEAM_VERMELHO) { return SendClientMessage(playerid, 0xFF000049, "Voce nao e da Gang VERMELHO"); } else { #pragma unused params GivePlayerWeapon(playerid, 2, 500); GivePlayerWeapon(playerid, 14, 500); GivePlayerWeapon(playerid, 22, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 28, 500); GivePlayerWeapon(playerid, 30, 500); GivePlayerWeapon(playerid, 33, 500); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,0x00FF0096,"Set Armas Adiqueridas"); return 1; } } CMD:averde(playerid,params[]) { if(Team[playerid] != TEAM_VERDE) { return SendClientMessage(playerid, 0xFF000049, "Voce nao e da Gang Verde"); } else { #pragma unused params GivePlayerWeapon(playerid, 2, 500); GivePlayerWeapon(playerid, 14, 500); GivePlayerWeapon(playerid, 22, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 28, 500); GivePlayerWeapon(playerid, 30, 500); GivePlayerWeapon(playerid, 33, 500); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,0x00FF0096,"Set Armas Verdes Adiqueridas"); return 1; } } CMD:aazul(playerid,params[]) { if(Team[playerid] != TEAM_AZUL) { return SendClientMessage(playerid, 0xFF000049, "Voce nao e da Gang azul"); } else { #pragma unused params GivePlayerWeapon(playerid, 2, 500); GivePlayerWeapon(playerid, 14, 500); GivePlayerWeapon(playerid, 22, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 28, 500); GivePlayerWeapon(playerid, 30, 500); GivePlayerWeapon(playerid, 33, 500); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,0x00FF0096,"Set Armas Azul Adiqueridas"); return 1; } } CMD:alaranja(playerid,params[]) { if(Team[playerid] != TEAM_LARANJA) { return SendClientMessage(playerid, 0xFF000049, "Voce nao e da Gang Laranja"); } else { #pragma unused params GivePlayerWeapon(playerid, 2, 500); GivePlayerWeapon(playerid, 14, 500); GivePlayerWeapon(playerid, 22, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 28, 500); GivePlayerWeapon(playerid, 30, 500); GivePlayerWeapon(playerid, 33, 500); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,0x00FF0096,"Set Armas Laranja Adiqueridas"); return 1; } }
CMD:alaranja(playerid,params[]) { if(Team[playerid] != TEAM_LARANJA) { #pragma unused params GivePlayerWeapon(playerid, 2, 500); GivePlayerWeapon(playerid, 14, 500); GivePlayerWeapon(playerid, 22, 500); GivePlayerWeapon(playerid, 25, 500); GivePlayerWeapon(playerid, 28, 500); GivePlayerWeapon(playerid, 30, 500); GivePlayerWeapon(playerid, 33, 500); GivePlayerMoney(playerid,-1000); SendClientMessage(playerid,0x00FF0096,"Set Armas Laranja Adiqueridas"); } else { return SendClientMessage(playerid, 0xFF000049, "Voce nao e da Gang Laranja"); return 1; } }
CMD:alaranja(playerid,params[])
{
if(Team[playerid] != TEAM_LARANJA) return SendClientMessage(playerid, 0xFF000049, "Voce nao e da Gang Laranja"); // aqui verifica se ele й da team, caso nao seja team vermelha envia a mensagem de erro.
// aqui caso ele tenha passado naquela verificaзгo ele recebe as armas...
#pragma unused params
GivePlayerWeapon(playerid, 2, 500);
GivePlayerWeapon(playerid, 14, 500);
GivePlayerWeapon(playerid, 22, 500);
GivePlayerWeapon(playerid, 25, 500);
GivePlayerWeapon(playerid, 28, 500);
GivePlayerWeapon(playerid, 30, 500);
GivePlayerWeapon(playerid, 33, 500);
GivePlayerMoney(playerid,-1000);
SendClientMessage(playerid,0x00FF0096,"Set Armas Laranja Adiqueridas");
return 1;
}