[Ajuda] Sistema Vip -
SynVengeance - 02.05.2012
Queria passar esse sistema vip para /setarvip [ID] [Dias] quando termina o dias o vip ser retirado sozinho alguem pode mi ajudar ?
Код HTML:
if (strcmp(cmd, "/setarvip", true) == 0)
{
if (!IsPlayerAdmin(playerid)) return 0;
new tmp[128];
new plid;
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, 0x008040AA, "(ERRO) Use: /setarvip [id].");
return 1;
}
plid = strval(tmp);
if (IsPlayerConnected(plid))
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
dini_IntSet(file2, "VIP", 1);
SpawnPlayer(playerid);
SendClientMessage(playerid, 0x00FF00AA, "(INFO) VIP Setado com sucesso");
SendClientMessage(plid, 0x00FF00AA, "(INFO) Um admin setou VIP para vocк aproveite ;D");
return 1;
}
else
{
SendClientMessage(playerid, Vermelho, "(ERRO) ID invбlido");
return 1;
}
}
Re: [Ajuda] Sistema Vip -
Trigo - 02.05.2012
Mano... eu fiz agora aki na facul...
sou iniciante ainda mano... axo q vai ter alguns bugzinhos... mais usa de base pelo menos..
Teste ai.. *--*
pawn Код:
//No topo
new VMinutos[MAX_PLAYERS],VHoras[MAX_PLAYERS],VDia[MAX_PLAYERS],TimerVip;
// Coloca no OnPlayerConnect
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
VMinutos[playerid] = dini_Int(file2, "MinutosVip");
VHoras[playerid] = dini_Int(file2, "HorasVip");
VDia[playerid] = dini_Int(file2, "DiasVip");
TimerVip = SetTimerEx("DiasDeVip",60000,1,"i",playerid);
//Coloca no OnPlayerDisconnect
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
dini_IntSet(file2, "DiasVip", VDia[playerid]);
dini_IntSet(file2, "HorasVip", VHoras[playerid]);
dini_IntSet(file2, "MinutosVip", VMinutos[playerid]);
KillTimer(TimerVip);
if (strcmp(cmd, "/setarvip", true) == 0)
{
if (!IsPlayerAdmin(playerid)) return 0;
new tmp[128];
new plid,dias;
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, 0x008040AA, "(ERRO) Use: /setarvip [id].");
return 1;
}
plid = strval(tmp);
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
{
SendClientMessage(playerid, 0x008040AA, "(ERRO) Use: /setarvip [id].");
return 1;
}
dias = strval(tmp);
if (IsPlayerConnected(plid))
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_CONTAS, pname);
dini_IntSet(file2, "VIP", 1);
dini_IntSet(file2, "DiasVip", dias-1);
dini_IntSet(file2, "HorasVip", 24);
dini_IntSet(file2, "MinutosVip", 60);
SpawnPlayer(playerid);
SendClientMessage(playerid, 0x00FF00AA, "(INFO) VIP Setado com sucesso");
SendClientMessage(plid, 0x00FF00AA, "(INFO) Um admin setou VIP para vocк aproveite ;D");
return 1;
}
else
{
SendClientMessage(playerid, Vermelho, "(ERRO) ID invбlido");
return 1;
}
}
forward DiasDeVip(playerid);
public DiasDeVip(playerid)
{
if(VDia[playerid]==0 && VHoras[playerid]==0 && VMinutos[playerid]==0) return 1;
VMinutos[playerid]--;
if(VMinutos[playerid]==0)
{
VHoras[playerid]--;
VMinutos[playerid]=60;
}
if(VHoras[playerid]==0)
{
VDia[playerid]--;
VHoras[playerid]=24;
}
return 1;
}
Caso outra pessoa veja algum erro ai... me avisa... ou arrume c tiver com boa vontade....
'-'
Respuesta: [Ajuda] Sistema Vip -
SynVengeance - 02.05.2012
nгo salva lek os dias ta zuado :S
Re: [Ajuda] Sistema Vip -
Trigo - 02.05.2012
tipo nao deu nenhum erro na compilaзгo?... pq eu nem compilei .. kkkkkkkkkkkkkk
Respuesta: [Ajuda] Sistema Vip -
SynVengeance - 02.05.2012
deu mais eu tirei fraga , mais nem salva os dias nada :S
Re: [Ajuda] Sistema Vip -
Trigo - 02.05.2012
tipo cara... usa ele como base pra fazer como vc quer.. *--*
quando eu chegar em casa eu vejo isso ai pra vc.... eu to na facul...
Re: [Ajuda] Sistema Vip -
Ricop522 - 02.05.2012
pawn Код:
vip[playerid] = gettime + (84600 * dias)
if(gettime() > vip[playerid]) {
vipacabo :/
}
Feito..
Respuesta: [Ajuda] Sistema Vip -
SynVengeance - 02.05.2012
isso server pra que ? e aonde coloco
vip[playerid] = gettime + (84600 * dias)
if(gettime() > vip[playerid]) {
vipacabo :/
}