[13/2/2019] - MitsuK_WizzarD -
Mitsukwizzard - 13.02.2019
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.
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;
}
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.
Re: [13/2/2019] - MitsuK_WizzarD -
Felipealves - 13.02.2019
Remova alguns ifs, da uns ajuste e, vualб, vocк acaba de editar um cmd de uma gm da net
Re: [13/2/2019] - MitsuK_WizzarD -
Mitsukwizzard - 13.02.2019
OK agora como faзo para, Descontado dinheiro da sua conta do Banco quando comprar.
Se ele nгo tiver dinheiro suficiente aparecer uma mensagem para ele.
Re: [13/2/2019] - MitsuK_WizzarD -
AutoMatic2 - 13.02.2019
Era bom se mandasse como vc definiu o Saldo
Exemplo:
PHP Code:
Player[playerid][Saldo]
Vocк vк e troca. n vem postar undefined symbol nessa linha.
Basta fazer assim:
PHP Code:
if(Player[playerid][Saldo] < 10000)
return SendClientMessage(playerid, 0xFF0000FF, "| ERRO | Vocк nгo tem $10000 para comprar um VIP!");
Player[playerid][Saldo] =- 10000;
10000 Seria o valor de 1 VIP
Re: [13/2/2019] - MitsuK_WizzarD -
Mitsukwizzard - 13.02.2019
Ok mas onde coloco esse cуdigo.
PHP Code:
if(strcmp(cmd, "/comprarsocio", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /comprarsocio [id] [Numero: 1 - 15kk Bronze, 2 - 20kk Prata, 3 - 25kk Ouro, 4 - 30kk Platina, 5 - 50kk Diamante] [30]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /comprarsocio [id] [Numero: 1 - 15kk Bronze, 2 - 20kk Prata, 3 - 25kk Ouro, 4 - 30kk Platina, 5 - 50kk Diamante] [30]");
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: /comprarsocio [id] [Numero: 1 - 15kk Bronze, 2 - 20kk Prata, 3 - 25kk Ouro, 4 - 30kk Platina, 5 - 50kk Damante] [30]");
return 1;
}
if(!IsNumero(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /comprarsocio [id] [Numero: 1 - 15kk Bronze, 2 - 20kk Prata, 3 - 25kk Ouro, 4 - 30kk Platina, 5 - 50kk Diamante] [30]");
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
if(JogadorInfo[para1][pSocio] == 1)
{
format(string, sizeof(string),"* Vocк compro [Sуcio Bronze] por [15 KK] por:[%d] dias.", strval(result));//Administrador: %s setou:[Sуcio Bronze] em vocк por:[%d] dias.
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),"* Vocк compro [Sуcio Prata] por [20 KK] por:[%d] dias.", 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),"* Vocк compro [Sуcio Ouro] por [25 KK] por:[%d] dias.", 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),"* Vocк compro [Sуcio Platina] por [30 KK] por:[%d] dias.", 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),"* Vocк compro [Sуcio Diamante] por [50 KK] por:[%d] dias.", strval(result));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
JogadorInfo[para1][pLevel] += 12;
JogadorInfo[para1][pConta] += 3000000;
ScoreLevel(para1);
}
format(string, sizeof(string), "%s compro Sуcio nнvel %d (%d/%d/%d - %d:%d)",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;
}
Re: [13/2/2019] - MitsuK_WizzarD -
AutoMatic2 - 13.02.2019
Na public de comandos.
Re: [13/2/2019] - MitsuK_WizzarD -
Mitsukwizzard - 14.02.2019
O AutoMatic2 esse aqui colo onde. E entre meu codigo.
PHP Code:
if(Player[playerid][Saldo] < 10000)
return SendClientMessage(playerid, 0xFF0000FF, "| ERRO | Vocк nгo tem $10000 para comprar um VIP!");
Player[playerid][Saldo] =- 10000;