Seguinte,
Meu Sуcio, e Dividido em VIP, Exemplo [pVIP] >= 1 -- VIP Normal [pVIP] >= 2 -- VIP Premium [pVIP] >= 3 -Sуcio [pVIP] >= 4 - Sуcio Master
pawn Код:
if(strcmp(cmd, "/darvip", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 1342)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
return 1;
}
VipVaga();
if(VagaSobrando == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparvip primeiro.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [Nivel]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [Nivel]");
return 1;
}
level = strval(tmp);
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
format(string, sizeof string, "Vocк deu VIP Nнvel %d para %s", level, giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof string, "Vocк ganhou VIP Nнvel %d do admin %s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
getdate(year, month, day);
gettime(hour,minute,second);
format(string, sizeof(string), "%s deu vip ao %s nнvel %d (%d/%d/%d - %d:%d)",sendername,giveplayer,level,day, month, year,hour, minute);
VipsLog(string);
PlayerInfo[para1][pVIP] = level;
new var03 = 0;
for(new i = 0; i < sizeof(VipInfo); i++)
{
if(strcmp(giveplayer,VipInfo[i][vNick],true)==0)
{
VipInfo[i][vTipo] = level;
SaveVip();
var03 = 1;
break;
}
}
if(var03 == 0)
{
for(new i = 0; i < sizeof(VipInfo); i++)
{
if(strcmp("Ninguem",VipInfo[i][vNick],true)==0)
{
strmid(VipInfo[i][vNick], giveplayer, 0, strlen(giveplayer), 255);
VipInfo[i][vTipo] = level;
SaveVip();
break;
}
}
}
}
}
}
return 1;
}
PAYDAY - /COMPRARNIVEL
pawn Код:
public PayDay()
{
new Conta,interest;
new rent = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
if(PlayerInfo[i][pLevel] > 0)
{
if(MoneyMessage[i]==1)
{
SendClientMessage(i, COLOR_LIGHTRED, "Vocк nгo pagou a sua dнvida e foi preso.");
GameTextForPlayer(i, "~r~Preso!", 2000, 1);
SetPlayerInterior(i, 6);
SetPlayerPos(i, 264.6288,77.5742,1001.0391);
PlayerInfo[i][pJailed] = 1;
ResetPlayerWeaponsEx(i);
WantedPoints[i] = 0;
SetPlayerWantedLevel(i, 0);
PlayerInfo[i][pJailTime] = 600;
format(gstring, sizeof(gstring), "Vocк foi preso por %d segundos.", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_LIGHTBLUE, gstring);
}
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
Conta = PlayerInfo[i][pConta];
new key = PlayerInfo[i][pPHousekey];
if(key != 255)
{
rent = HouseInfo[key][hRent];
if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
rent = 0;
}
else if(rent > GetPlayerMoneyEx(i))
{
PlayerInfo[i][pPHousekey] = 255;
SendClientMessage(i, COLOR_WHITE, "Vocк foi expulso(a).");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
}
new tmpintrate;
if(PlayerInfo[i][pVIP] == 1) { tmpintrate = 3; }
else if(PlayerInfo[i][pVIP] == 2) { tmpintrate = 4; }
else if(PlayerInfo[i][pVIP] == 3) { tmpintrate = 6; }
else if(PlayerInfo[i][pVIP] == 4) { tmpintrate = 8; }
else { tmpintrate = 1; }
if(PlayerInfo[i][pPayDay] >= 3)
{
Tax += TaxValue;//Shorld work for every player online
PlayerInfo[i][pConta] -= TaxValue;
new checks = PlayerInfo[i][pSalario];
new ebill = (PlayerInfo[i][pConta]/30000)*(PlayerInfo[i][pLevel]);
ConsumingMoney[i] = 1;
GivePlayerMoneyEx(i, checks);
if(PlayerInfo[i][pConta] > 0)
{
PlayerInfo[i][pConta] -= ebill;
SBizzInfo[4][sbTill] += ebill;
}
else
{
ebill = 0;
}
interest = (PlayerInfo[i][pConta]/1000)*(tmpintrate);
PlayerInfo[i][pExp]++;
PlayerPlayMusic(i);
PlayerInfo[i][pConta] = Conta+interest;
SendClientMessage(i, COLOR_WHITE, "|______________ Pagamento ______________|");
format(gstring, sizeof(gstring), " Salбrio: R$%d Imposto: -R$%d", checks, TaxValue);
SendClientMessage(i, COLOR_GRAD1, gstring);
SendClientMessage(i, COLOR_GRAD1, " Mйdico: R$300");
if(PlayerInfo[i][pPHousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
format(gstring, sizeof(gstring), " Energia: -R$%d", ebill);
SendClientMessage(i, COLOR_GRAD1, gstring);
}
format(gstring, sizeof(gstring), " Banco: R$%d", Conta);
SendClientMessage(i, COLOR_GRAD1, gstring);
format(gstring, sizeof(gstring), " Juros: 0.%d por cento",tmpintrate);
SendClientMessage(i, COLOR_GRAD2, gstring);
SendClientMessage(i, COLOR_GRAD4, "|_______________________________________|");
format(gstring, sizeof(gstring), " Novo extrato: R$%d", PlayerInfo[i][pConta]);
SendClientMessage(i, COLOR_GRAD5, gstring);
format(gstring, sizeof(gstring), " Aluguel: -R$%d", rent);
SendClientMessage(i, COLOR_GRAD5, gstring);
PlayerPlaySound(i, 1185, 0.0, 0.0, 0.0);
format(gstring, sizeof(gstring), "~y~-==- ~g~ BTP Salario ~y~ -==-");
GameTextForPlayer(i, gstring, 5000, 1);
GivePlayerMoneyEx(i,- 300);
rent = 0;
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pSalario] = 0;
PlayerInfo[i][pCaixinha] = 0;
PlayerInfo[i][pConnectTime] += 1;
pban[i] = 0;
if(PlayerInfo[i][pEmprego] > 0)
{
if(PlayerInfo[i][pContractTime] < 25)
{
PlayerInfo[i][pContractTime] ++;
}
}
}
else
{
SendClientMessage(i, COLOR_LIGHTRED, "* Vocк nгo jogou tempo suficiente para receber salбrio!.");
}
}
}
new lolbagui;
lolbagui = PlayerInfo[i][pExp];
new nxtlevel = PlayerInfo[i][pLevel]+1;
if(lolbagui >= nxtlevel*levelexp)
{
GameTextForPlayer(i, "~g~Respeito Adquirido!~n~~r~Digite /comprarnivel!", 5000, 1);
}
}
OOCNews(COLOR_WHITE, "Loteria: Ja comecou a loteria.");
new rand = random(80);
if(rand < 77) { rand += 3; }
Lotto(rand);
Checkprop();
//return 1;
}
stock strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
stock strtokEx(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[64];
while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
public split(const strsrc[], strdest[][], delimiter)
{
new i, li;
new aNum;
new len;
while(i <= strlen(strsrc)){
if(strsrc[i]==delimiter || i==strlen(strsrc)){
len = strmid(strdest[aNum], strsrc, li, i, 128);
strdest[aNum][len] = 0;
li = i+1;
aNum++;
}
i++;
}
return 1;
}