17.08.2011, 21:08
pawn Код:
#include <a_samp>
#include <dini>
#if defined FILTERSCRIPT
#define Bope 0x000000FF
new VBope[4];
new tmp[128]
enum Info
{
Bope,
};
new PlayerInfo[MAX_PLAYERS][Info];
forward VerificarVeiculo(playerid);
public VerificarVeiculo(playerid)
{
for(new c = 0; c <= 4; c++)
{
if(IsPlayerInVehicle(playerid, VBope[c]) && PlayerInfo[playerid][Bope] < 1)
{
SendClientMessage(playerid, 0x000000FF, "Vocк nгo й do Bope");
RemovePlayerFromVehicle(playerid);
return 1;
}
}
return 1;
}
forward SalvarOrg(playeri);
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][Bope] > 0) dini_IntSet(arquivo, "Bope", PlayerInfo[playerid][Bope]);
}
return 1;
}
#else
#endif
public OnGameModeInit()
{
VBope[0] = CreateVehicle(596,1656.21496582,-1718.64465332,20.30437469,0.00000000, 40, 40, 999); //Veiculo numero 0
VBope[1] = CreateVehicle(596,1665.98400879,-1719.47753906,20.30437469,0.00000000, 40, 40, 999); //Veiculo numero 1
VBope[2] = AddStaticVehicleEx(596,1656.21496582,-1718.64465332,20.30437469,0.00000000,40,40,40); //vbope
VBope[3] = AddStaticVehicleEx(596,1665.98400879,-1719.47753906,20.30437469,0.00000000,40,40,40); //vbope
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/convidar", true) == 0)
{
tmp = strtok(cmdtext, idx);
new PlayerB;
if(!strlen(tmp)) return SendClientMessage(playerid, 0x000000FF, "Uso correto: /convidar [id]");
PlayerB = strval(tmp);
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, 0x000000FF, "Este jogador nгo estб conectado");
if(PlayerInfo[playerid][Bope] >= 35)
{
PlayerInfo[PlayerB][Bope] = 1;
SendClientMessage(PlayerB, 0x000000FF, "Vocк entrou no Bope");
SetPlayerColor(PlayerB, 0x000000FF);
return 1;
}
return 1;
}
if(strcmp(cmd, "/promover", true) == 0)
{
tmp = strtok(cmdtext, idx);
new PlayerB, level;
if(!strlen(tmp)) return SendClientMessage(playerid, 0x000000FF, "Uso correto: /promover [id] [cargo]");
PlayerB = strval(tmp);
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, 0x000000FF, "Este jogador nгo estб conectado");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, 0x000000FF, "Uso correto: /promover [id] [cargo]");
level = strval(tmp);
if(level < 1 || level > 6) return SendClientMessage(playerid, 0x000000FF, "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][Bope] >= 35)
{
if(PlayerInfo[PlayerB][Bope] < 35) return SendClientMessage(playerid, 0x000000FF, "Este jogador nгo й da sua org");
PlayerInfo[PlayerB][Bope] = level;
format(string, sizeof(string), "Vocк foi promovido a level %d por %s", level, promovedor););
SendClientMessage(PlayerB, Branco, string);
return 1;
}
if(strcmp(cmd, "/demitir", true) == 0)
{
tmp = strtok(cmdtext, idx);
new PlayerB, string[128], demitidor[MAX_PLAYER_NAME];
if(!strlen(tmp)) return SendClientMessage(playerid, 0x000000FF, "Uso correto: /demitir [id]");
PlayerB = strval(tmp);
GetPlayerName(playerid, demitidor, sizeof(demitidor));
if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, 0x000000FF, "Este jogador nгo estб conectado");
if(PlayerInfo[playerid][Bope] >= 35)
{
if(PlayerInfo[PlayerB][Bope] < 1) return SendClientMessage(playerid, 0x000000FF, "Este jogador nгo й da sua organizaзгo");
PlayerInfo[PlayerB][Bope] = 0;
format(string, sizeof(string), "Vocк foi demitido por %s", demitidor);
SendClientMessage(PlayerB, Branco, string);
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(newstate == PLAYER_STATE_DRIVER) VerificarVeiculo(playerid);
return 1;
}