if(strcmp(cmd, "/Darvip", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 5){
}
new tmp[256];
new plid;
new year, month,day;
new hour, minute, second;
new giveplayer[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, 0x008040AA, "{0099FF}[x]{CCCCFF} Use: /setarvip [id] [Dias].");
return 1;
}
plid = strval(tmp);
if(IsPlayerConnected(plid)){
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_Vips, pname);
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,day, month, year,hour, minute);
dini_IntSet(file2, "VIP",1);
SpawnPlayer(plid);
SendClientMessage(playerid, 0x00FF00AA, "{0099FF}(~){CCCCFF} VIP Setado com sucesso");
SendClientMessage(plid, 0x00FF00AA, "{0099FF}(~){CCCCFF} O Administrador(a)%s Ti Deu VIP de %d Dias aproveite");
return 1;
}else{
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} ID invбlido");
return 1;
}
}
if(strcmp(cmd, "/Darvip", true) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 5)
{
new tmp[256];
new plid;
new year, month,day;
new hour, minute, second;
new giveplayer[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0x008040AA, "{0099FF}[x]{CCCCFF} Use: /setarvip [id] [Dias].");
return 1;
}
plid = ReturnUser(tmp);
if(IsPlayerConnected(plid))
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_Vips, pname);
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,day, month, year,hour, minute);
dini_IntSet(file2, "VIP",1);
SpawnPlayer(plid);
SendClientMessage(playerid, 0x00FF00AA, "{0099FF}(~){CCCCFF} VIP Setado com sucesso");
SendClientMessage(plid, 0x00FF00AA, "{0099FF}(~){CCCCFF} O Administrador(a)%s Ti Deu VIP de %d Dias aproveite");
return 1;
}
else
{
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} ID invбlido");
return 1;
}
}
}
|
Tente assim:
pawn Код:
|
|
*_* vlw man mais agora o meu sistema de vip ai com dias estб correto? ou tem que fazer forward sauvarvip < tipo assim
|
enum vvinfo
{
vDia,
vMes,
vAno,
vDiaA,
vMesA,
vAnoA
};
new VipInfo[100][vvinfo];
if(strcmp(cmd, "/Darvip", true) == 0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 5)
{
new tmp[256];
new plid;
new year, month,day;
new hour, minute, second;
new giveplayer[MAX_PLAYER_NAME];
new sendername[MAX_PLAYER_NAME];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0x008040AA, "{0099FF}[x]{CCCCFF} Use: /setarvip [id] [Dias].");
return 1;
}
plid = ReturnUser(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, 0x008040AA, "{0099FF}[x]{CCCCFF} Use: /setarvip [id] [Dias].");
return 1;
}
dias = strval(tmp);
if(IsPlayerConnected(plid) && dias > 0)
{
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file2, sizeof(file2), PASTA_Vips, pname);
getdate(year, month, day);
gettime(hour,minute,second);
VipInfo[playerid][vDia] = day;
VipInfo[playerid][vMes] = month;
VipInfo[playerid][vAno] = year;
VipInfo[playerid][vDiaA] = day+dias;
VipInfo[playerid][vMesA] = month;
VipInfo[playerid][vAnoA] = year;
if(month != 2 && day > 30 || month == 2 && day > 28)
{
VipInfo[playerid][vMesA] = month+1;
}
if(VipInfo[playerid][vMesA] > 12)
{
VipInfo[playerid][vAnoA] = year+1;
}
VipInfo[playerid][vAnoA] = year;
SalvarVIP(playerid);
format(string, sizeof(string), "%s deu vip ao %s Com %d dias(%d/%d/%d - %d:%d)",sendername,giveplayer,dias, month, year,hour, minute);
dini_IntSet(file2, "VIP",1);
SpawnPlayer(plid);
SendClientMessage(playerid, 0x00FF00AA, "{0099FF}(~){CCCCFF} VIP Setado com sucesso");
SendClientMessage(plid, 0x00FF00AA, "{0099FF}(~){CCCCFF} O Administrador(a)%s Ti Deu VIP de %d Dias aproveite");
return 1;
}
else
{
SendClientMessage(playerid, Vermelho, "{0099FF}[x]{CCCCFF} ID invбlido");
return 1;
}
}
}