Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #include dini
- #define Cor_PMilitar 0x4169E199
- #define Cor_Groove 0x00FF0099
- #define Cor_Ballas 0xA020F099
- #define Branco 0xFFFFFFFF
- enum Info
- {
- PMilitar,
- Groove,
- Ballas
- };
- new PlayerInfo[MAX_PLAYERS][Info];
- new VPMilitar[5];
- public OnGameModeInit()
- {
- VPMilitar[0] = CreateVehicle(400, 1469.9976, -1722.6470, 22.0803, 0, 1, 1, -1); //Veiculo numero 0
- VPMilitar[1] = CreateVehicle(400, 1469.9976, -1722.6470, 22.0803, 0, 1, 1, -1); //Veiculo numero 1
- VPMilitar[2] = CreateVehicle(400, 1469.9976, -1722.6470, 22.0803, 0, 1, 1, -1); //Veiculo numero 2
- VPMilitar[3] = CreateVehicle(400, 1469.9976, -1722.6470, 22.0803, 0, 1, 1, -1); //Veiculo numero 3
- }
- public OnPlayerCommandText(playerid, cmd[])
- {
- new tmp[128];
- if(strcmp(cmd, "/convidar", true) == 0)
- {
- tmp = strtok(cmd, idx);
- new PlayerB;
- if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /convidar [id]");
- PlayerB = strval(tmp);
- if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador não está conectado");
- if(PlayerInfo[playerid][PMilitar] >= 6)
- {
- PlayerInfo[PlayerB][PMilitar] = 1;
- SendClientMessage(PlayerB, Branco, "Você entrou à Polícia Militar");
- SetPlayerColor(PlayerB, Cor_PMilitar);
- return 1;
- }
- else if(PlayerInfo[playerid][Groove] >= 6)
- {
- PlayerInfo[PlayerB][Groove] = 1;
- SendClientMessage(PlayerB, Branco, "Você entrou à Groove");
- SetPlayerColor(PlayerB, Cor_Groove);
- return 1;
- }
- else if(PlayerInfo[playerid][Ballas] >= 6)
- {
- PlayerInfo[PlayerB][Ballas] = 1;
- SendClientMessage(PlayerB, Branco, "Você entrou aos Ballas");
- SetPlayerColor(PlayerB, Cor_Ballas);
- return 1;
- }
- return 0;
- }
- if(strcmp(cmd, "/promover", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- new PlayerB, level;
- if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
- PlayerB = strval(tmp);
- if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador não está conectado");
- tmp = strtok(cmdtext, idx);
- if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
- level = strval(tmp);
- if(level < 1 || level > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7");
- new string[128], promovedor[MAX_PLAYER_NAME];
- GetPlayerName(playerid, promovedor, sizeof(promovedor));
- if(PlayerInfo[playerid][PMilitar] >= 6)
- {
- if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador não é da sua org");
- PlayerInfo[PlayerB][PMilitar] = level;
- format(string, sizeof(string), "Você foi promovido a level %d por %s", level, promovedor););
- SendClientMessage(PlayerB, Branco, string);
- return 1;
- }
- else if(PlayerInfo[playerid][Groove] >= 6)
- {
- if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador não é da sua org");
- PlayerInfo[PlayerB][Groove] = level;
- format(string, sizeof(string), "Você foi promovido a level %d por %s", level, promovedor););
- SendClientMessage(PlayerB, Branco, string);
- return 1;
- }
- else if(PlayerInfo[playerid][Ballas] >= 6)
- {
- if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador não é da sua org");
- PlayerInfo[PlayerB][Ballas] = level;
- format(string, sizeof(string), "Você foi promovido a level %d por %s", level, promovedor););
- SendClientMessage(PlayerB, Branco, string);
- return 1;
- }
- return 0;
- }
- if(strcmp(cmd, "/demitir", true) == 0)
- {
- tmp = strtok(cmdtext, idx);
- new PlayerB, string[128], demitidor[MAX_PLAYER_NAME];
- if(!strlen(tmp)) return SendClientMessage(playerid, Branco, "Uso correto: /demitir [id]");
- PlayerB = strval(tmp);
- GetPlayerName(playerid, demitidor, sizeof(demitidor));
- if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, Branco, "Este jogador não está conectado");
- if(PlayerInfo[playerid][PMilitar] >= 6)
- {
- if(PlayerInfo[PlayerB][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador não é da sua organização");
- PlayerInfo[PlayerB][PMilitar] = 0;
- format(string, sizeof(string), "Você foi demitido por %s", demitidor);
- SendClientMessage(PlayerB, Branco, string);
- return 1;
- }
- else if(PlayerInfo[playerid][Groove] >= 6)
- {
- if(PlayerInfo[PlayerB][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador não é da sua organização");
- PlayerInfo[PlayerB][Groove] = 0;
- format(string, sizeof(string), "Você foi demitido por %s", demitidor);
- SendClientMessage(PlayerB, Branco, string);
- return 1;
- }
- else if(PlayerInfo[playerid][Ballas] >= 6)
- {
- if(PlayerInfo[PlayerB][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador não é da sua organização");
- PlayerInfo[PlayerB][Ballas] = 0;
- format(string, sizeof(string), "Você foi demitido por %s", demitidor);
- SendClientMessage(PlayerB, Branco, string);
- }
- return 1;
- {
- return 0;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER) VerificarVeiculo(playerid);
- {
- }
- return 1;
- }
- forward VerificarVeiculo(playerid);
- public VerificarVeiculo(playerid)
- {
- for(new c = 0; c <= 4; c++)
- {
- if(IsPlayerInVehicle(playerid, VPMilitar[c]) && PlayerInfo[playerid][PMilitar] < 1)
- {
- SendClientMessage(playerid, Branco, "Você não é da Policia Militar");
- RemovePlayerFromVehicle(playerid);
- return 1;
- }
- forward SalvarOrg(playerid);
- public SalvarOrg(playerid)
- {
- new arquivo[60], nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nome, sizeof(nome));
- format(arquivo, sizeof(arquivo), "Contas\%s.ini", nome);
- }
- if(!dini_Exists(arquivo))
- {
- dini_Create(arquivo);
- }
- if(PlayerInfo[playerid][PMilitar] > 0) dini_IntSet(arquivo, "PMilitar", PlayerInfo[playerid][PMilitar]);
- if(PlayerInfo[playerid][Groove] > 0) dini_IntSet(arquivo, "Groove", PlayerInfo[playerid][Groove]);
- if(PlayerInfo[playerid][Ballas] > 0) dini_IntSet(arquivo, "Ballas", PlayerInfo[playerid][Ballas]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement