[Ajuda] Sistema de salario nгo funciona
#1

Sou novo em pawno e esse sistema de payday da o dinheiro ao player mas depois o dinheiro some do nada. ajuda ai por favor

PHP код:
public paytime(playerid)
{
    new 
hhmmss;
    
gettimehhmmss );
    if( 
mm == )
    {
        for(new 
0MAX_PLAYERSi++) if(IsPlayerConnected(i))
        {
            new 
string[128];
            new 
RandomPay random(5000 725) + 725;
            
GivePlayerMoneyplayeridRandomPay );
            
SendClientMessage(playeridCOLOR_AMARELO,"Vocк recebeu seu salario");
            
format(stringsizeof(string), "Salario> $%i"RandomPay);
            
SendClientMessage(iCOLOR_AMARELOstring);
            
SendClientMessage(playeridCOLOR_AMARELO,"Vб deposita-lo");
        }
    }
    return 
1;

Reply
#2

Quote:
Originally Posted by joaocvitor
Посмотреть сообщение
Sou novo em pawno e esse sistema de payday da o dinheiro ao player mas depois o dinheiro some do nada. ajuda ai por favor

PHP код:
public paytime(playerid)
{
    new 
hhmmss;
    
gettimehhmmss );
    if( 
mm == )
    {
        for(new 
0MAX_PLAYERSi++) if(IsPlayerConnected(i))
        {
            new 
string[128];
            new 
RandomPay random(5000 725) + 725;
            
GivePlayerMoneyplayeridRandomPay );
            
SendClientMessage(playeridCOLOR_AMARELO,"Vocк recebeu seu salario");
            
format(stringsizeof(string), "Salario> $%i"RandomPay);
            
SendClientMessage(iCOLOR_AMARELOstring);
            
SendClientMessage(playeridCOLOR_AMARELO,"Vб deposita-lo");
        }
    }
    return 
1;

Creio que esteja editando algum Game Mode, entгo procure saber qual a proteзгo do Money Hacker este GM utiliza. Se o servidor tiver um Anti Money Hacker, o GivePlayerMoney nгo farб efeito no game.
Reply
#3

Na minha gm aparece GivePlayerGrana botei isso no fs vamos ver se vai funfar
Reply
#4

n funcionou e tem q ser em fs pq se n n pega por causa do relogio ajuda ai

malz pelo double esqueci do botao editar
Reply
#5

Vocк terб de por o pagamento no Game Mode, para editar a maneira de pagamento para GivePlayerGrana.
Ou se a proteзгo estб em include, vб no FS e utilize:
PHP код:
#include <include> 
Onde estб <include>, vocк coloca o nome da include do Anti Money Hacker, lembre-se, sу farб isso se estiver em include.
Reply
#6

Se nao tiver em include use CallRemoteFunction, para chamar a funcao do GM para o fs
Reply
#7

no fs eu botei isso aki e n adiantou
PHP код:
stock GivePlayerGrana(playeridmoney){
CallRemoteFunction("GivePlayerGrana""dd"playeridmoney);
return 
1;

edit:
Achei uma include q deve ter algo haver ajuda ai o q eu faзo agora no topo da gm estб sу assim
PHP код:
//Includes
#include <a_samp>
#include <c_vehicleinfo>
#include <a_players>
#include <a_vehicles>
#include <dini>
#include <cpstream>
//#include <utils>
//#include <nnfanticheater>
#include <sscanf2>
#include <streamer>
#include <foreach>
#include <antibot>
Itter_Create(VehicleMAX_VEHICLES);
//#include <moneyprotect> 
include moneyprotect
PHP код:
/****
==========================
    Money Protect v1.1    
==========================
Author: Jones N. Sperandio
Release date: 26/02/2010
__________________________
Description/Descriзгo
PT:
Provк proteзгo contra money hack, sem que seja preciso alterar vбrias linhas de
um script.
EN:
Provides protection against money hacking, without having to change several lines
of code.                 
__________________________
Notes/Notas
PT:
Caso seja usado em um filterscript, o mesmo deve conter a diretiva
#define FILTERSCRIPT, antes da diretiva #include, e o gamemode precisa ter sido
compilado com o include tambйm.
EN:
In case of a filterscript, it must contain the directive #define FILTERSCRIPT
before the #include directive, and the gamemode script must be compiled with
the include, too.
****/
#if defined __MONEY_PROTECT__
    #endinput    
#endif
#define __MONEY_PROTECT__
#if defined FILTERSCRIPT
    #define FUNC::%1(%2) stock %1(%2)    
#else
    #define FUNC::%1(%2) forward %1(%2); public %1(%2)    
#endif
#if !defined FILTERSCRIPT
#if !defined foreach
    #tryinclude <foreach>
#endif
#if !defined foreach
    #define foreach(%1,%2) for(new %2; %2 < MAX_PLAYERS; %2++) if(IsPlayerConnected(%2))    
    #define __MP_FOREACH    
#endif
#if !defined MP_TIMER_INTERVAL
    #define MP_TIMER_INTERVAL 500    
#endif
forward MoneyProtectTimer();
new
    
__MP_Money[MAX_PLAYERS];    
static
    
bool:__MP_HAS_OPC,
    
bool:__MP_HAS_OMCD;
public 
MoneyProtectTimer()
{
    foreach(
Playerplayerid)
    {
        if(
GetPlayerMoney(playerid) > __MP_Money[playerid])
        {
            if(
__MP_HAS_OMCD)
                
CallLocalFunction("OnMoneyCheatDetect""dd"playeridGetPlayerMoney(playerid)-__MP_Money[playerid]);
            
GivePlayerMoney(playerid__MP_Money[playerid]-GetPlayerMoney(playerid));
        }
        else
        {
            
__MP_Money[playerid] = GetPlayerMoney(playerid);
        }
    }
}
public 
OnGameModeInit()
{
    
SetTimer("MoneyProtectTimer"MP_TIMER_INTERVALtrue);
    if(
funcidx("__MP_OnGameModeInit") != -1)
        
CallLocalFunction("__MP_OnGameModeInit""");
    
__MP_HAS_OPC = (funcidx("__MP_OnPlayerConnect") != -1);
    
__MP_HAS_OMCD = (funcidx("OnMoneyCheatDetect") != -1);  
}
public 
OnPlayerConnect(playerid)
{
    
__MP_ResetPlayerMoney(playerid);    
    if(
__MP_HAS_OPC)
        
CallLocalFunction("__MP_OnPlayerConnect""d"playerid); 
}
#endif
                        
FUNC::__MP_GivePlayerMoney(playeridamount)
{
    
#if defined FILTERSCRIPT    
        
return CallRemoteFunction("__MP_GivePlayerMoney""dd"playeridamount);        
    
#else
        
__MP_Money[playerid] += amount;    
        return 
GivePlayerMoney(playeridamount);        
    
#endif
}
                        
FUNC::__MP_ResetPlayerMoney(playerid)
{
    
#if defined FILTERSCRIPT    
        
return CallRemoteFunction("__MP_ResetPlayerMoney""d"playerid);        
    
#else
        
__MP_Money[playerid] = 0;    
        return 
ResetPlayerMoney(playerid);        
    
#endif
}   
                        
FUNC::__MP_GetPlayerMoney(playerid)
{
    
#if defined FILTERSCRIPT    
        
return CallRemoteFunction("__MP_GetPlayerMoney""d"playerid);        
    
#else
        
return __MP_Money[playerid];
    
#endif
}
#define GivePlayerMoney __MP_GivePlayerMoney
#define ResetPlayerMoney __MP_ResetPlayerMoney
#define GetPlayerMoney __MP_GetPlayerMoney 
#if defined FILTERSCRIPT
    #endinput    
#endif
#if defined _ALS_OnGameModeInit
    #undef OnGameModeInit
#else
    #define _ALS_OnGameModeInit
#endif
#if defined _ALS_OnPlayerConnect
    #undef OnPlayerConnect
#else
    #define _ALS_OnPlayerConnect
#endif
#define OnGameModeInit __MP_OnGameModeInit     
#define OnPlayerConnect __MP_OnPlayerConnect
forward OnGameModeInit();
forward OnPlayerConnect(playerid);
forward OnMoneyCheatDetect(playeridamount);
#if defined __MP_FOREACH
    #undef foreach
    #undef __MP_FOREACH    
#endif 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)