Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #include zcmd
- #include sscanf
- #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
- }
- CMD:convidar(playerid, params[])
- {
- new id;
- if(sscanf(params, "d", id)) return SendClientMessage(playerid, Branco, "Uso correto: /convidar [id]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, Branco, "Este jogador não está conectado");
- if(PlayerInfo[playerid][PMilitar] >= 6)
- {
- PlayerInfo[id][PMilitar] = 1;
- SendClientMessage(id, Branco, "Você entrou à Polícia Militar");
- SetPlayerColor(id, Cor_PMilitar);
- }
- else if(PlayerInfo[playerid][Groove] >= 6)
- {
- PlayerInfo[id][Groove] = 1;
- SendClientMessage(id, Branco, "Você entrou à Groove");
- SetPlayerColor(id, Cor_Groove);
- }
- else if(PlayerInfo[playerid][Ballas] >= 6)
- {
- PlayerInfo[id][Ballas] = 1;
- SendClientMessage(id, Branco, "Você entrou aos Ballas");
- SetPlayerColor(id, Cor_Ballas);
- }
- return 1;
- }
- new string[128], promovedor[MAX_PLAYER_NAME];
- CMD:promover(playerid, params[])
- {
- new id, cargo;
- if(sscanf(params, "dd", id, cargo)) return SendClientMessage(playerid, Branco, "Uso correto: /promover [id] [cargo]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, Branco, "Este jogador não está conectado");
- if(cargo < 1 || cargo > 6) return SendClientMessage(playerid, Branco, "O level deve ser maior que 0 e menor que 7");
- GetPlayerName(playerid, promovedor, sizeof(promovedor));
- }
- if(PlayerInfo[playerid][PMilitar] >= 6)
- {
- if(PlayerInfo[id][PMilitar] < 1) return SendClientMessage(playerid, Branco, "Este jogador não é da sua org");
- PlayerInfo[id][PMilitar] = cargo;
- SendClientMessage(id, Branco, string);
- }
- else if(PlayerInfo[id][Groove] >= 6)
- {
- if(PlayerInfo[id][Groove] < 1) return SendClientMessage(playerid, Branco, "Este jogador não é da sua org");
- PlayerInfo[id][Groove] = cargo;
- SendClientMessage(id, Branco, string);
- }
- else if(PlayerInfo[playerid][Ballas] >= 6)
- {
- if(PlayerInfo[id][Ballas] < 1) return SendClientMessage(playerid, Branco, "Este jogador não é da sua org");
- PlayerInfo[id][Ballas] = cargo;
- format(string, sizeof(string), "Você foi promovido a cargo %d por %s", cargo, promovedor);
- SendClientMessage(id, Branco, string);
- }
- return 1;
- }
- 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