SA-MP Forums Archive
GivePlayerMoney - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GivePlayerMoney (/showthread.php?tid=653357)



GivePlayerMoney - oOoBl4cKoOo - 02.05.2018

Hey guys
i have installed "Pilot Job" filterscript
but i have some problems with my anti-cheat
when i reach the checkpoint i will get money but server will take them

PHP код:
#include <a_samp>
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xFF0000C8
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_BLUE 0x0000BBAA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_LIME 0x10F441AA
#define COLOR_MAGENTA 0xFF00FFFF
#define COLOR_NAVY 0x000080AA
#define COLOR_AQUA 0xF0F8FFAA
#define COLOR_CRIMSON 0xDC143CAA
#define COLOR_FLBLUE 0x6495EDAA
#define COLOR_BISQUE 0xFFE4C4AA
#define COLOR_BLACK 0x000000AA
#define COLOR_CHARTREUSE 0x7FFF00AA
#define COLOR_BROWN 0XA52A2AAA
#define COLOR_CORAL 0xFF7F50AA
#define COLOR_GOLD 0xB8860BAA
#define COLOR_GREENYELLOW 0xADFF2FAA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_IVORY 0xFFFF82AA
#define COLOR_LAWNGREEN 0x7CFC00AA
#define COLOR_SEAGREEN 0x20B2AAAA
#define COLOR_LIMEGREEN 0x32CD32AA //<--- Dark lime
#define COLOR_MIDNIGHTBLUE 0X191970AA
#define COLOR_MAROON 0x800000AA
#define COLOR_OLIVE 0x808000AA
#define COLOR_ORANGERED 0xFF4500AA
#define COLOR_PINK 0xFFC0CBAA // - Light light pink
#define COLOR_SPRINGGREEN 0x00FF7FAA
#define COLOR_TOMATO 0xFF6347AA // - Tomato >:/ sounds wrong lol... well... :P
#define COLOR_YELLOWGREEN 0x9ACD32AA //- like military green
#define COLOR_MEDIUMAQUA 0x83BFBFAA
#define COLOR_MEDIUMMAGENTA 0x8B008BAA // dark magenta ^^
enum {
    
STAGE_IDLE,
    
STAGE_UNLOAD,
    
STAGE_LOAD
}
new 
MissionStage[MAX_PLAYERS];
new 
FloatgAirports[][] = {
    { 
1579.6099,1460.0630,10.8307},//lva
    
{ -1353.9780,-238.9976,14.1484 },//sfa
    
1563.6893,-2449.4089,13.5547 },//lsa
    
389.6915,2530.2002,16.5391 }//vma
};
public 
OnPlayerConnect(playerid) {
    
MissionStage[playerid] = STAGE_IDLE;
    return 
true;
}
AirportMissionStart(playerid) {
    if(
MissionStage[playerid] == STAGE_IDLE) {
        if(
GetVehicleModel(GetPlayerVehicleID(playerid)) == 519) {
            new
                
idx,
                
Floattmp,
                
Floatdist GetPlayerDistanceFromPoint(playeridgAirports[0][0], gAirports[0][1], gAirports[0][2])
            ;
            for(new 
1sizeof gAirports; ++i) {
                
tmp GetPlayerDistanceFromPoint(playeridgAirports[i][0], gAirports[i][1], gAirports[i][2]);
                if(
tmp dist) {
                    
dist tmp;
                    
idx i;
                }
            }
            
MissionStage[playerid] = STAGE_LOAD idx;
            return 
SetPlayerCheckpoint(playeridgAirports[idx][0], gAirports[idx][1], gAirports[idx][2], 20.0);
        }
    }
    return 
false;
}
AirportMissionEnd(playerid) {
    if(
MissionStage[playerid] != STAGE_IDLE) {
        
MissionStage[playerid] = STAGE_IDLE;
        return 
DisablePlayerCheckpoint(playerid);
    }
    return 
false;
}
public 
OnPlayerCommandText(playeridcmdtext[]) {
    if (
strcmp("/Work"cmdtexttrue) == 0) {
        if(
AirportMissionStart(playerid)) {
           
SendClientMessage(playeridCOLOR_INDIGO"You have Started your Work !");
           return 
true;
        }
        return 
SendClientMessage(playeridCOLOR_RED"You are already in a work!");
    }
    if (
strcmp("/dsstgrdy6uy6uyh6tuu7yu67u7uuj767ikiy7i5u756y765 m7y65m76576575m757rtyhfhgj67uj7yujgfjhgjhgjhgjhgjgh6757567ygjhgj65765765hytjhgj6675765"cmdtexttrue) == 0) {
        if(
AirportMissionEnd(playerid)) {
            
GivePlayerMoney(playerid, -10000);
            return 
SendClientMessage(playeridCOLOR_RED"You had Paid $10,000 for stopping your Work!");
        }
        return 
true;
    }
    return 
false;
}
public 
OnPlayerEnterCheckpoint(playerid) {
    switch(
MissionStage[playerid]) {
        case 
STAGE_IDLE: {} // do not remove
        
case STAGE_UNLOAD: {
            new
                
string[64]
            ;
            
FreezePlayer(playerid3000);
            
DisablePlayerCheckpoint(playerid);
            
SetPlayerScore(playeridGetPlayerScore(playerid) + 1);
            
GivePlayerMoney(playerid1500 random(4000));
            
GetPlayerName(playeridstringMAX_PLAYER_NAME);
            
strcat(string" Completed a Flight!");
            
SendClientMessageToAll(COLOR_ORANGEstring);
            
MissionStage[playerid] = STAGE_IDLE;
        }
        default: { 
// STAGE_LOAD
            
new
                
rand random(sizeof gAirports 1)
            ;
            if(
rand == (MissionStage[playerid] - STAGE_LOAD)) {
                
rand++;
            }
            
FreezePlayer(playerid3000);
            
DisablePlayerCheckpoint(playerid);
            
GameTextForPlayer(playerid"~g~All Set !"20004);
            
SetPlayerCheckpoint(playeridgAirports[rand][0], gAirports[rand][1], gAirports[rand][2], 10.0);
            
MissionStage[playerid] = STAGE_UNLOAD;
        }
    }
    return 
false;
}
public 
OnPlayerDeath(playeridkilleridreason) {
    
AirportMissionEnd(playerid);
    return 
true;
}
forward FreezePlayer(playeridtime);
public 
FreezePlayer(playeridtime) {
    if(
time) {
        
SetTimerEx("FreezePlayer"timefalse"ii"playerid0);
    }
    
TogglePlayerControllable(playerid, !time);




Re: GivePlayerMoney - SkmDanny - 02.05.2018

If you have an anti money hack like this:
PHP код:
new Cash[MAX_PLAYERS];
stock GivePlayerCash(playeridmoney)
{
    return 
Cash[playerid] += money;
}
stock GetPlayerCash(playerid)
{
    return 
Cash[playerid];
}
stock ResetPlayerCash(playerid)
{
    return 
Cash[playerid] = 0;

Edit all GivePlayerMoney with this (just if your anti hack money is like mine):
PHP код:
GivePlayerCash(playeridmoney); 
Example from your code:
PHP код:
GivePlayerCash(playerid1500 random(4000)); 



Re: GivePlayerMoney - oOoBl4cKoOo - 02.05.2018

PHP код:
new Pool[MAX_PLAYERS];
stock GivePlayerPool(playeridmoney)
{
    
Pool[playerid] += money;
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playerid,Pool[playerid]);
    
PlayerInfo[playerid][pCash] += money;
    
SaveKonVal(playerid"pCash"Pool[playerid]);
    return 
Pool[playerid];
}
stock GetPlayerPool2(playeridmoney)
{
    
Pool[playerid] -= money;
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playerid,Pool[playerid]);
    
SaveKonVal(playerid"pCash"Pool[playerid]);
    return 
Pool[playerid];
}
stock SetPlayerPool(playeridmoney)
{
    
Pool[playerid] = money;
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playerid,Pool[playerid]);
    
SaveKonVal(playerid"pCash"Pool[playerid]);
    return 
Pool[playerid];
}
stock ResetPlayerPool(playerid)
{
    
Pool[playerid] = 0;
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playerid,Pool[playerid]);
    
SaveKonVal(playerid"pCash"Pool[playerid]);
    return 
Pool[playerid];
}
stock GetPlayerPool(playerid)
{
    return 
Pool[playerid];

it's my anti money hack
Pool = Money


Re: GivePlayerMoney - SkmDanny - 02.05.2018

Quote:
Originally Posted by oOoBl4cKoOo
Посмотреть сообщение
PHP код:
new Pool[MAX_PLAYERS];
stock GivePlayerPool(playeridmoney)
{
    
Pool[playerid] += money;
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playerid,Pool[playerid]);
    
PlayerInfo[playerid][pCash] += money;
    
SaveKonVal(playerid"pCash"Pool[playerid]);
    return 
Pool[playerid];
}
stock GetPlayerPool2(playeridmoney)
{
    
Pool[playerid] -= money;
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playerid,Pool[playerid]);
    
SaveKonVal(playerid"pCash"Pool[playerid]);
    return 
Pool[playerid];
}
stock SetPlayerPool(playeridmoney)
{
    
Pool[playerid] = money;
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playerid,Pool[playerid]);
    
SaveKonVal(playerid"pCash"Pool[playerid]);
    return 
Pool[playerid];
}
stock ResetPlayerPool(playerid)
{
    
Pool[playerid] = 0;
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playerid,Pool[playerid]);
    
SaveKonVal(playerid"pCash"Pool[playerid]);
    return 
Pool[playerid];
}
stock GetPlayerPool(playerid)
{
    return 
Pool[playerid];

it's my anti money hack
Pool = Money
PHP код:
GivePlayerPooL(playeridmoney);
ResetPlayerPooL(playerid);
GetPlayerPooL(playerid); 
Where you have GivePlayerMoney you will change with GivePlayerPooL.