if(strcmp(cmd, "/setarvip", true) == 0) {
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, 0x008040AA, "| ERRO | Use: /setarvip [id] [Dias].");
return 1;
}
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
SendClientMessage("%02d:%02d:%02d", Hour, Minute, Second);
new Seconds = gettime();
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(plid);
SendClientMessage(playerid, 0x00FF00AA, "| INFO | VIP Setado com sucesso");
SendClientMessage(plid, 0x00FF00AA, "| INFO | Admin %s Deu VIP pra vocк de %d Dias");
return 1;
}else{
SendClientMessage(playerid, Vermelho, "| INFO | ID invбlido");
return 1;
}
}
pawn Код:
|
VipInfo[ID][vLevel] = Nivel;
VipInfo[ID][vDias] = (gettime() + (Dias * 24 * 60 * 60));
command(darvip, playerid, params[])
{
new ID, Nivel, Dias;
if(PlayerInfo[playerid][pAdmin] < 1)return SendClientMessage(playerid, -1,"[ERRO] Vocк nгo e admin!");
if(sscanf(params,"udd", ID, Nivel, Dias))return SendClientMessage(playerid, -1,"[USO] /darvip [ID] [Nivel] [Dias]");
if(!IsPlayerConnected(ID))return SendClientMessage(playerid, -1,"[ERRO] Id invalido!");
GetPlayerName(playerid, DName, sizeof(DName));
GetPlayerName(ID, DNameID, sizeof(DNameID));
VipInfo[ID][vLevel] = Nivel;
VipInfo[ID][vDias] = (gettime() + (Dias * 24 * 60 * 60));
format(Don,sizeof(Don),"[Aviso]Vocк ganhou vip nivel %s por %d dia(s) [By: %s]", NameVip[VipInfo[ID][vLevel]], Dias, DName);
SendClientMessage(ID, CorClasses[PlayerInfo[playerid][pClass]], Don);
format(Don,sizeof(Don),"[Aviso]Vocк deu vip nivel %s por %d dia(s) para %s.", NameVip[VipInfo[ID][vLevel]], Dias, DNameID);
SendClientMessage(playerid, CorClasses[PlayerInfo[playerid][pClass]], Don);
format(Donarquivo, sizeof(Donarquivo), VIPSALVO, DName);
if(!DOF2_FileExists(Donarquivo))DOF2_CreateFile(Donarquivo);
DOF2_SetInt(Donarquivo, "Nivel",VipInfo[playerid][vLevel]);
DOF2_SetInt(Donarquivo, "Dias",VipInfo[playerid][vDias]);
DOF2_SaveFile();
return true;
}
ormat(Donarquivo, sizeof(Donarquivo), VIPSALVO, DName);
if(DOF2_FileExists(Donarquivo))
{
if(gettime() >= DOF2_GetInt(Donarquivo, "Dias"))
{
DOF2_SetInt(Donarquivo, "Nivel", 0);
DOF2_SetInt(Donarquivo, "Dias", 0);
DOF2_SaveFile();
SendClientMessage(playerid, -1, "{00F00F}[Aviso]{FFFFFF} Seu vip expirou ou vocк nгo tinha vip!");
DOF2_RemoveFile(Donarquivo);
}
VipInfo[playerid][vDias] = DOF2_GetInt(Donarquivo, "Dias");
VipInfo[playerid][vLevel] = DOF2_GetInt(Donarquivo, "Nivel");
Vips++;
JogadoresOn++;
}
[if(strcmp(cmd, "/setarvip", true) == 0) {
if(!IsPlayerAdmin(playerid)) return 0;
new tmp[256];
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, 0x008040AA, "| ERRO | Use: /setarvip [id] [Dias].");
return 1;
}
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
SendClientMessage("%02d:%02d:%02d", Hour, Minute, Second);
new Seconds = gettime();
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(plid);
SendClientMessage(playerid, 0x00FF00AA, "| INFO | VIP Setado com sucesso");
SendClientMessage(plid, 0x00FF00AA, "| INFO | Admin %s Deu VIP pra vocк de %d Dias");
return 1;
}else{
SendClientMessage(playerid, Vermelho, "| INFO | ID invбlido");
return 1;
}
}