13.02.2019, 10:42
Olб Pessoal quem pode transformar esse comando de Admin, em comando de compra para todos os player, quero que os player de /comprarvip e /comprarsocio.
Quando um player comprar um dos tipos.
Exemplo ele dar /comprarsocio escolhendo tipo de sуcio, E descontado dinheiro do seu RG, E aparecera uma mensagem para todos, Player tal, Copro sуcio tal, Por tal valor, Por 30 dias, E setando automaticamente 30 dias, do que ele compro. Caso o player nгo tenha dinheiro aparecera para ele, Vocк nгo tem dinheiro o suficiente, E assim nгo efetuando a compra.
Quem poder por favor.
PHP Code:
if(strcmp(cmd, "/darsocio", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(JogadorInfo[playerid][pAdmin] < 1340)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id] [Nivel] [dias]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id] [Nivel] [dias]");
return 1;
}
level = strval(tmp);
if(level < 1 || level > 5) { return 1; }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id] [Nivel] [dias]");
return 1;
}
if(!IsNumero(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darsocio [id] [Nivel] [dias]");
return 1;
}
getdate(year, month, day);
gettime(hour,minute,second);
SBizzInfo[5][sbTill] += 5000;
ExtortionSBiz(5, 5000);
JogadorInfo[para1][pSocio] = level;
if(level == 5 && level == 4)
{
JogadorInfo[para1][pVIP] = 3;
}
else
{
JogadorInfo[para1][pVIP] = level;
}
if(JogadorInfo[para1][pSocio] == 1)
{
format(string, sizeof(string), "Vocк setou:[Sуcio Bronze], para %s, por:[%d] dias.",giveplayer, strval(result));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else if(JogadorInfo[para1][pSocio] == 2)
{
format(string, sizeof(string), "Vocк setou:[Sуcio Prata], para %s, por:[%d] dias.",giveplayer, strval(result));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else if(JogadorInfo[para1][pSocio] == 3)
{
format(string, sizeof(string), "Vocк setou:[Sуcio Ouro], para %s, por:[%d] dias.",giveplayer, strval(result));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else if(JogadorInfo[para1][pSocio] == 4)
{
format(string, sizeof(string), "Vocк setou:[Sуcio Platina], para %s, por:[%d] dias.",giveplayer, strval(result));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else if(JogadorInfo[para1][pSocio] == 5)
{
format(string, sizeof(string), "Vocк setou:[Sуcio Diamante], para %s, por:[%d] dias.",giveplayer, strval(result));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
if(JogadorInfo[para1][pSocio] == 1)
{
format(string, sizeof(string),"* Administrador: %s setou:[Sуcio Bronze] em vocк por:[%d] dias.",sendername, strval(result));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
JogadorInfo[para1][pLevel] += 3;
JogadorInfo[para1][pConta] += 300000;
ScoreLevel(para1);
}
else if(JogadorInfo[para1][pSocio] == 2)
{
format(string, sizeof(string),"* Administrador: %s setou:[Sуcio Prata] em vocк por:[%d] dias.",sendername, strval(result));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
JogadorInfo[para1][pLevel] += 4;
JogadorInfo[para1][pConta] += 400000;
ScoreLevel(para1);
}
else if(JogadorInfo[para1][pSocio] == 3)
{
format(string, sizeof(string),"* Administrador: %s setou:[Sуcio Ouro] em vocк por:[%d] dias.",sendername, strval(result));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
JogadorInfo[para1][pLevel] += 5;
JogadorInfo[para1][pConta] += 500000;
ScoreLevel(para1);
}
else if(JogadorInfo[para1][pSocio] == 4)
{
format(string, sizeof(string),"* Administrador: %s setou:[Sуcio Platina] em vocк por:[%d] dias.",sendername, strval(result));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
JogadorInfo[para1][pLevel] += 8;
JogadorInfo[para1][pConta] += 1000000;
ScoreLevel(para1);
}
else if(JogadorInfo[para1][pSocio] == 5)
{
format(string, sizeof(string),"* Administrador: %s setou:[Sуcio Diamante] em vocк por:[%d] dias.",sendername, strval(result));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
JogadorInfo[para1][pLevel] += 12;
JogadorInfo[para1][pConta] += 3000000;
ScoreLevel(para1);
}
format(string, sizeof(string), "%s deu Sуcio ao %s nнvel %d (%d/%d/%d - %d:%d)",sendername,giveplayer,level,day, month, year,hour, minute);
SendClientMessage(playerid, COLOR_YELLOW, string);
VipsLog(string);
JogadorInfo[para1][pDiaVIP] = strval(result);
OnPlayerSave(para1);
for(new i = 0; i < sizeof(VipInfo); i++)
{
if(strcmp(PlayerName(para1),VipInfo[i][vNome],true)==0)
{
if(level > 3)
{
VipInfo[i][vTipo] = 3;
}
else
{
VipInfo[i][vTipo] = level;
}
VipInfo[i][vDias] = JogadorInfo[para1][pDiaVIP];
SaveVip();
break;
}
if(strcmp("Ninguem",VipInfo[i][vNome],true)==0)
{
strmid(VipInfo[i][vNome], PlayerName(para1), 0, strlen(PlayerName(para1)), 255);
if(level > 3)
{
VipInfo[i][vTipo] = 3;
}
else
{
VipInfo[i][vTipo] = level;
}
VipInfo[i][vDias] = JogadorInfo[para1][pDiaVIP];
SaveVip();
break;
}
}
}
}
}
return 1;
}
if(strcmp(cmd, "/darvip", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(JogadorInfo[playerid][pAdmin] < 1340)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [Nivel] [dias]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [Nivel] [dias]");
return 1;
}
level = strval(tmp);
if(level < 1 || level > 3) { return 1; }
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [Nivel] [dias]");
return 1;
}
if(!IsNumero(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /darvip [id] [Nivel] [dias]");
return 1;
}
getdate(year, month, day);
gettime(hour,minute,second);
SBizzInfo[5][sbTill] += 5000;
ExtortionSBiz(5, 5000);
JogadorInfo[para1][pVIP] = level;
if(JogadorInfo[para1][pVIP] == 1)
{
format(string, sizeof(string), "Vocк setou:[Vip Bronze], para %s, por:[%d] dias.",giveplayer, strval(result));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
if(JogadorInfo[para1][pVIP] == 2)
{
format(string, sizeof(string), "Vocк setou:[Vip Prata], para %s, por:[%d] dias.",giveplayer, strval(result));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
if(JogadorInfo[para1][pVIP] == 3)
{
format(string, sizeof(string), "Vocк setou:[Vip Ouro], para %s, por:[%d] dias.",giveplayer, strval(result));
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
if(JogadorInfo[para1][pVIP] == 1)
{
format(string, sizeof(string), "* Administrador: %s setou:[Vip Bronze] em vocк por:[%d] dias.",sendername, strval(result));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
JogadorInfo[para1][pLevel] += 2;
JogadorInfo[para1][pConta] += 100000;
ScoreLevel(para1);
}
if(JogadorInfo[para1][pVIP] == 2)
{
format(string, sizeof(string), "* Administrador: %s setou:[Vip Prata] em vocк por:[%d] dias.",sendername, strval(result));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
JogadorInfo[para1][pLevel] += 3;
JogadorInfo[para1][pConta] += 120000;
ScoreLevel(para1);
}
if(JogadorInfo[para1][pVIP] == 3)
{
format(string, sizeof(string), "* Administrador: %s setou:[Vip Ouro] em vocк por:[%d] dias.",sendername, strval(result));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
JogadorInfo[para1][pLevel] += 4;
JogadorInfo[para1][pConta] += 150000;
ScoreLevel(para1);
}
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);
SendClientMessage(playerid, COLOR_YELLOW, string);
VipsLog(string);
JogadorInfo[para1][pDiaVIP] = strval(result);
OnPlayerSave(para1);
for(new i = 0; i < sizeof(VipInfo); i++)
{
if(strcmp(PlayerName(para1),VipInfo[i][vNome],true)==0)
{
VipInfo[i][vTipo] = level;
VipInfo[i][vDias] = JogadorInfo[para1][pDiaVIP];
SaveVip();
break;
}
if(strcmp("Ninguem",VipInfo[i][vNome],true)==0)
{
strmid(VipInfo[i][vNome], PlayerName(para1), 0, strlen(PlayerName(para1)), 255);
VipInfo[i][vTipo] = level;
VipInfo[i][vDias] = JogadorInfo[para1][pDiaVIP];
SaveVip();
break;
}
}
}
}
}
return 1;
}
Exemplo ele dar /comprarsocio escolhendo tipo de sуcio, E descontado dinheiro do seu RG, E aparecera uma mensagem para todos, Player tal, Copro sуcio tal, Por tal valor, Por 30 dias, E setando automaticamente 30 dias, do que ele compro. Caso o player nгo tenha dinheiro aparecera para ele, Vocк nгo tem dinheiro o suficiente, E assim nгo efetuando a compra.
Quem poder por favor.