[Pedido] Sistema de moedas/cash
#1

Bom, estou querendo um sistema de moedas/cash/god... com alguns comandos...

EX: /recebermoedas /comprarvip /comprarsocio /comprarorvip /vendermoedas... e um comando para o adm Subdono setar as moedas, e um menu se der.
Reply
#2

https://sampforum.blast.hk/showthread.php?pid=2249016#pid2249016
https://sampforum.blast.hk/showthread.php?tid=406455
https://sampwiki.blast.hk/wiki/ShowPlayerDialog

Bons estudos
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=369308
https://sampforum.blast.hk/showthread.php?tid=422697
Reply
#4

Nossa cara estuda usar search , fazer um sistema desse й bem facil porem , gasta tempo...

Quote:

new CASH[MAX_PLAYERS];

stock GivePlayerCash(playerid, cash){
CASH[playerid] = CASH[playerid] += cash;
return 1;
}

stock GetPlayerCash(playerid){
return CASH[playerid];
}
//na public
if(GetPlayerCash(playerid) >= 36){

}

GivePlayerCash(playerid, 14);

Reply
#5

Entregue sua vida e seus problemas, Fale com Deus, Ele vai ajudar vocк.
Reply
#6

Brother fiz uma base, dб para vocк aprender e aproveitar muita coisa com ela, nгo sei se vocк usa DOF2 como salvamento, porйm os mais usados pela minha visгo se eu estiver errado por favor alguйm me corrija й dof2 e mysql.
Se for DOF2 serб mas fбcil ainda para vocк! Bom estб ai!
Bom estudo.
Lembrando, nunca mas venha no fуrum pedindo comandos, e sim bases no mбximo! donde vocк possa estudar e fazer vocк mesmo.
PHP код:
/* Includes */
#include <a_samp> // Nosso amigo Samp
#include <dof2> // Salvamento
#include <zcmd> // Processador de comandos
/* VARIAVEIS */
new Moedas[MAX_PLAYERS];
main()
{
    print(
"\n----------------------------------");
    print(
" MOEDAS BY CAITON ");
    print(
"----------------------------------\n");
}
public 
OnGameModeInit()
{
    
SetGameModeText("Moedas Base Caiton");
    
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
    return 
1;
}
public 
OnGameModeExit()
{
    
DOF2_Exit();
    return 
1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
    
SetPlayerPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraLookAt(playerid1958.37831343.157215.3746);
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
DOF2_CreateFile(PegarConta(playerid));//Criando arquivo do player que conectar obs: fiz para testes, vc nгo vб usar isso no seu servidor.
    
return 1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
/*Salvei as moedas ao sair*/
    
DOF2_SetInt(PegarConta(playerid), "Moedas"Moedas[playerid]);
    
DOF2_SaveFile();
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
/* SETEI AS MOEDAS AO SPAWNAR, RECOMENDO POR ISSO APУS ACERTAR A SENHA*/
    
if(DOF2_FileExists(PegarConta(playerid)))
    {
        
Moedas[playerid] = DOF2_GetInt(PegarConta(playerid), "Moedas");
    }
    return 
1;
}
/* COMANDOS BASE PARA ESTUDO */
CMD:minhasmoedas(playerid)
{
    new 
Msg[120];
    
format(Msgsizeof(Msg), "Vocк tem %d moedas."Moedas[playerid]);/* Diz a quantidade de moedas que voce tem */
    
SendClientMessage(playerid,-1,Msg);
    return 
1;
}
CMD:perdimoedas(playerid)
{
    
Moedas[playerid]--;
    new 
Msg[120];
    
format(Msgsizeof(Msg), "Vocк perdeu +1 moeda, agora Vocк agora estб com %d moedas."Moedas[playerid]); /* Vocк perde 1 moeda */
    
SendClientMessage(playerid,-1,Msg);
    return 
1;
}
CMD:ganheimoedas(playerid)
{
    
Moedas[playerid]++;
    new 
Msg[120];
    
format(Msgsizeof(Msg), "Vocк ganhou +1 moeda, agora Vocк agora estб com %d moedas."Moedas[playerid]);/* Vocк ganha 1 moeda */
    
SendClientMessage(playerid,-1,Msg);
    return 
1;
}
CMD:ganharduasmoedas(playerid)
{
    
Moedas[playerid]+=2;
    new 
Msg[120];
    
format(Msgsizeof(Msg), "Vocк ganhou +2 moeda, agora Vocк agora estб com %d moedas."Moedas[playerid]); /* Vocк ganha duas moedas */
    
SendClientMessage(playerid,-1,Msg);
    return 
1;
}
stock Nome(playerid)
{
        static 
Name[MAX_PLAYER_NAME]; GetPlayerName(playeridNamesizeof(Name)); return Name;
}
stock PegarConta(playerid)
{
        static 
Arquivo[33]; format(Arquivosizeof(Arquivo), "Players/%s.ini"Nome(playerid)); return Arquivo;

Reply
#7

nгo esta salvando
Reply
#8

Quote:
Originally Posted by Caiton
Посмотреть сообщение
Brother fiz uma base, dб para vocк aprender e aproveitar muita coisa com ela, nгo sei se vocк usa DOF2 como salvamento, porйm os mais usados pela minha visгo se eu estiver errado por favor alguйm me corrija й dof2 e mysql.
Se for DOF2 serб mas fбcil ainda para vocк! Bom estб ai!
Bom estudo.
Lembrando, nunca mas venha no fуrum pedindo comandos, e sim bases no mбximo! donde vocк possa estudar e fazer vocк mesmo.
PHP код:
/* Includes */
#include <a_samp> // Nosso amigo Samp
#include <dof2> // Salvamento
#include <zcmd> // Processador de comandos
/* VARIAVEIS */
new Moedas[MAX_PLAYERS];
main()
{
    print(
"\n----------------------------------");
    print(
" MOEDAS BY CAITON ");
    print(
"----------------------------------\n");
}
public 
OnGameModeInit()
{
    
SetGameModeText("Moedas Base Caiton");
    
AddPlayerClass(01958.37831343.157215.3746269.1425000000);
    return 
1;
}
public 
OnGameModeExit()
{
    
DOF2_Exit();
    return 
1;
}
public 
OnPlayerRequestClass(playeridclassid)
{
    
SetPlayerPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraPos(playerid1958.37831343.157215.3746);
    
SetPlayerCameraLookAt(playerid1958.37831343.157215.3746);
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
DOF2_CreateFile(PegarConta(playerid));//Criando arquivo do player que conectar obs: fiz para testes, vc nгo vб usar isso no seu servidor.
    
return 1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
/*Salvei as moedas ao sair*/
    
DOF2_SetInt(PegarConta(playerid), "Moedas"Moedas[playerid]);
    
DOF2_SaveFile();
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
/* SETEI AS MOEDAS AO SPAWNAR, RECOMENDO POR ISSO APУS ACERTAR A SENHA*/
    
if(DOF2_FileExists(PegarConta(playerid)))
    {
        
Moedas[playerid] = DOF2_GetInt(PegarConta(playerid), "Moedas");
    }
    return 
1;
}
/* COMANDOS BASE PARA ESTUDO */
CMD:minhasmoedas(playerid)
{
    new 
Msg[120];
    
format(Msgsizeof(Msg), "Vocк tem %d moedas."Moedas[playerid]);/* Diz a quantidade de moedas que voce tem */
    
SendClientMessage(playerid,-1,Msg);
    return 
1;
}
CMD:perdimoedas(playerid)
{
    
Moedas[playerid]--;
    new 
Msg[120];
    
format(Msgsizeof(Msg), "Vocк perdeu +1 moeda, agora Vocк agora estб com %d moedas."Moedas[playerid]); /* Vocк perde 1 moeda */
    
SendClientMessage(playerid,-1,Msg);
    return 
1;
}
CMD:ganheimoedas(playerid)
{
    
Moedas[playerid]++;
    new 
Msg[120];
    
format(Msgsizeof(Msg), "Vocк ganhou +1 moeda, agora Vocк agora estб com %d moedas."Moedas[playerid]);/* Vocк ganha 1 moeda */
    
SendClientMessage(playerid,-1,Msg);
    return 
1;
}
CMD:ganharduasmoedas(playerid)
{
    
Moedas[playerid]+=2;
    new 
Msg[120];
    
format(Msgsizeof(Msg), "Vocк ganhou +2 moeda, agora Vocк agora estб com %d moedas."Moedas[playerid]); /* Vocк ganha duas moedas */
    
SendClientMessage(playerid,-1,Msg);
    return 
1;
}
stock Nome(playerid)
{
        static 
Name[MAX_PLAYER_NAME]; GetPlayerName(playeridNamesizeof(Name)); return Name;
}
stock PegarConta(playerid)
{
        static 
Arquivo[33]; format(Arquivosizeof(Arquivo), "Players/%s.ini"Nome(playerid)); return Arquivo;

Um MACRO nгo seria mais simplificado do que uma stock?
PHP код:
#define PegarConta "Players/%s.ini" 
Reply
#9

Bom, quero uma FS completa, ou uma BASE server tbm.
Reply
#10

Quote:
Originally Posted by ipsLuan
Посмотреть сообщение
Entregue sua vida e seus problemas, Fale com Deus, Ele vai ajudar vocк.
Kkkkkk luan sempre zoando kkkkk, ta certo
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)