14.12.2013, 01:55
Gente eu queria esses como base pra mudar mt comando de admin q tem q dar pros caras comprarem sozinhos, jogando
Eu queria q alguem transforma-se o /darvip [id] [mes]
Em /comprarvip
O player ganharia 1 mes de VIP e perderia 10k, sу de base
Eu queria q alguem transforma-se o /darvip [id] [mes]
Em /comprarvip
O player ganharia 1 mes de VIP e perderia 10k, sу de base
pawn Код:
if(strcmp(cmd, "/darvip", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 1342)
{
QQIssoNovinha;
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [Meses]");
return 1;
}
new para1;
new level;
new meses;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
meses = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [Meses]");
return 1;
}
level = strval(tmp);
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(level < 1)return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo pode definir para 0 meses!");
format(string, sizeof string, "Vocк deu %d meses de VIP para %s", level, giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof string, "Admin %s te deu %d meses de VIP com R$%d, Aproveite Nossos beneficios!", sendername, 1*meses, 10000*meses);
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] = 1;
PlayerInfo[para1][pTimeVIP] = 0;
GivePlayerMoney(para1, 10000*meses);
//ScoreLevel(para1);
PlayerInfo[para1][pDiaVIP] = day;
PlayerInfo[para1][pMesVIP] = month+level;
PlayerInfo[para1][pAnoVIP] = year;
if(PlayerInfo[para1][pMesVIP] > 12)
{
PlayerInfo[para1][pMesVIP] -= 12;
PlayerInfo[para1][pAnoVIP]++;
}
OnPlayerUpdate(para1);
}
}
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/darsocio", true) == 0 || strcmp(cmd, "/dsocio", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 1342)
{
QQIssoNovinha;
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id] [Meses]");
return 1;
}
new para1;
new level;
new meses;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
meses = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id] [Meses]");
return 1;
}
level = strval(tmp);
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(level < 1)return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Vocк nгo pode definir para 0 meses!");
format(string, sizeof string, "Vocк deu %d Meses de Socio para %s", level, giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof string, "Admin %s te deu %d meses de Socio com R$%d e %d Niveis, Aproveite Nossos beneficios!", sendername, level, 100000*meses, 1*meses);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
getdate(year, month, day);
PlayerInfo[para1][pLevel] += 6*meses;
gettime(hour,minute,second);
format(string, sizeof(string), "%s deu Socio ao %s nнvel %d (%d/%d/%d - %d:%d)",sendername,giveplayer,level,day, month, year,hour, minute);
VipsLog(string);
PlayerInfo[para1][pSocio] = 1;
GivePlayerMoney(para1, 100000*meses);
ScoreLevel(para1);
PlayerInfo[para1][pDiaSocio] = day;
PlayerInfo[para1][pMesSocio] = month+level;
PlayerInfo[para1][pAnoSocio] = year;
if(PlayerInfo[para1][pMesSocio] > 12)
{
PlayerInfo[para1][pMesSocio] -= 12;
PlayerInfo[para1][pAnoSocio]++;
}
OnPlayerUpdate(para1);
}
}
}
return true;
}