03.08.2012, 22:46
Eae galera й um seguinte tentei fazer o comando vip pegando o comando prender e fui vendo algumas coisas e colokano mais n consegui procurei na pastebin e achei este mais tem um problema este n esta rodando os segundos e minutos e horas e dias n tenho ideia de como fazer cуdigo :
Alguem me ajuda ae desde ja agradecido *-*
pawn Код:
CMD:makevip(playerid, params[])
{
new playerb, viptime, viphour, vipminute, vipsecond, string[128];
new pname[MAX_PLAYER_NAME],pbname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerName(playerb, pbname, sizeof(pbname));
if(sscanf(params, "uiiii", playerb, viptime, viphour,vipminute,vipsecond)) return SendClientMessage(playerid, -1, "USAGE: /makevip [playerid] [dias] [horas] [minutos] [Secundos]");
if(viptime < 1 || viptime > 360) return SendClientMessage(playerid, -1, "Limite Maximo de 1 a 360 dias.");
if(viphour < 1 || viphour > 24) return SendClientMessage(playerid, -1, "Limite maximo de 1 a 24 horas.");
if(vipminute < 1 || vipminute > 59) return SendClientMessage(playerid, -1, "Minutos maximo de 1 a 59.");
// Calculating
new Year, Month, Day;
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
getdate(Year, Month, Day);
if(Day+viptime >= 360)
{
PlayerInfo[playerb][pVIPDay] = viptime;
PlayerInfo[playerb][pVIPMonth] = Month;
PlayerInfo[playerb][pVIPHour] = viphour;
PlayerInfo[playerb][pVIPMinute] = vipminute;
PlayerInfo[playerb][pVIPSecond] = vipsecond;
}
else
{
PlayerInfo[playerb][pVIPDay] = viptime;
PlayerInfo[playerb][pVIPMonth] = Month;
PlayerInfo[playerb][pVIPHour] = viphour;
PlayerInfo[playerb][pVIPMinute] = vipminute;
PlayerInfo[playerb][pVIPSecond] = vipsecond;
}
// Done
PlayerInfo[playerb][pVIPTemp] = 0;
format(string, sizeof(string), "AdmWarn: %s has given %s VIP package for %d days.", pname, pbname, viptime);
SendClientMessage(playerid, -1, string);
format(string, sizeof(string), " Adminisistrator %s has given you VIP package for %d days horas %d Minutos %d Segundos %d.", pname, viptime, viphour, vipminute, vipsecond);
SendClientMessage(playerb, -1, string);
return 1;
}
//VIPS
CMD:vips(playerid, params[])
{
new string[128];
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "You need to login first before using any command.");
SendClientMessage(playerid, -1, "[Online VIPs]");
foreach(Player, i)
{
if(PlayerInfo[i][pVIPDay])
{
format(string, sizeof(string), "Vip %s [Tempo restante: Dias %d, %dh, %dm, %ds]", Name(i), PlayerInfo[i][pVIPDay], PlayerInfo[i][pVIPHour], PlayerInfo[i][pVIPMinute], PlayerInfo[i][pVIPSecond]);
SendClientMessage(playerid, -1, string);
}
}
return 1;
}