SA-MP Forums Archive
Money Problems - 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: Money Problems (/showthread.php?tid=586496)



Money Problems - DerickClark - 22.08.2015

I do not wanted to make a message for this one
Код:
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] +  trucker[End][cost];
after i got the cash from ^ it send me a message saying
Код:
format(string, 128, "%s possbile hack (Possible Money Hacks)", pName, playerid);
only for the ones who hacking the money.
Код:
if(GetPlayerMoney(playerid) != PlayerInfo[playerid][pCash])
    {
        GivePlayerMoney(playerid, -GetPlayerMoney(playerid));
        GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
        // Player's a hacker, do whatever u want with him
        new string[180];
   	   	if (PlayerInfo[playerid][pAdmin] >= 3)
     	{
           for (new i; i < MAX_PLAYERS; i++)
	       {
               new pName[MAX_PLAYER_NAME];
               GetPlayerName(playerid, pName, sizeof(pName));
               format(string, 128, "%s possbile hack (Possible Money Hacks)", pName, playerid);
               SendClientMessage(i, -1, string);
	       }
	    }
    }



Re: Money Problems - Logofero - 22.08.2015

PHP код:
if(GetPlayerMoney(playerid) > PlayerInfo[playerid][pCash])
{
        
GivePlayerMoney(playerid, -GetPlayerMoney(playerid));
        
GivePlayerMoney(playeridPlayerInfo[playerid][pCash]);
        
// Player's a hacker, do whatever u want with him
        
new string[180];
              if (
PlayerInfo[playerid][pAdmin] >= 3)
         {
        for (new 
iMAX_PLAYERSi++)
           {
               new 
pName[MAX_PLAYER_NAME];
               
GetPlayerName(playeridpNamesizeof(pName));
               
format(string128"%s possbile hack (Possible Money Hacks)"pNameplayerid);
               
SendClientMessage(i, -1string);
           }
    }
} else if (
GetPlayerMoney(playerid) < PlayerInfo[playerid][pCash]) {
       
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);

PS: Better yet, make a delay before the change, to avoid false alarms.


Re: Money Problems - DerickClark - 22.08.2015

It's still sending messages, when i get money from the server. i don't want to send the message to the ones to the admins. who didn't hack the money. The ones who hacked the money will be send to the admins.


Re: Money Problems - Logofero - 22.08.2015

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
It's still sending messages, when i get money from the server. i don't want to send the message to the ones to the admins. who didn't hack the money. The ones who hacked the money will be send to the admins.
Try

PHP код:
if(GetPlayerMoney(playerid) > PlayerInfo[playerid][pCash])
{
        
GivePlayerMoney(playerid, -GetPlayerMoney(playerid));
        
GivePlayerMoney(playeridPlayerInfo[playerid][pCash]);
        
// Player's a hacker, do whatever u want with him
        
new string[180];
        new 
pName[MAX_PLAYER_NAME];
        
GetPlayerName(playeridpNamesizeof(pName));
        
format(string128"%s possbile hack (Possible Money Hacks)"pNameplayerid);
        for (new 
GetPlayerPoolSize(); >= 0; --p) {
          if (
PlayerInfo[p][pAdmin] >= 3) {
               
               
               
SendClientMessage(p, -1string);
       }
    }
} else if (
GetPlayerMoney(playerid) < PlayerInfo[playerid][pCash]) {
       
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);




Re: Money Problems - DerickClark - 22.08.2015

still sending me that message when i use /rescue

Код:
CMD:rescue(playerid, params[])
{
    if ((GetPlayerState(playerid) == PLAYER_STATE_WASTED) || GetPlayerState(playerid) == PLAYER_STATE_NONE) return 0;
    if(GetPlayerTeam(playerid) == TEAM_TRUCKER)
    {
       new rand = random(sizeof(TruckerSpawn));
       SetPlayerPos(playerid, TruckerSpawn[rand][SpawnX], TruckerSpawn[rand][SpawnY], TruckerSpawn[rand][SpawnZ]);
       SetPlayerFacingAngle(playerid, TruckerSpawn[rand][SpawnAngle]);
	}
    if(GetPlayerTeam(playerid) == TEAM_COP)
    {
       new rand = random(sizeof(CopSpawn));
       SetPlayerPos(playerid, CopSpawn[rand][SpawnX], CopSpawn[rand][SpawnY], CopSpawn[rand][SpawnZ]);
       SetPlayerFacingAngle(playerid, CopSpawn[rand][SpawnAngle]);
	}
	SetPlayerVirtualWorld(playerid, 1);
	Loadingmap(playerid);
    SendClientMessage(playerid, COLOUR_YELLOW, "You been rescued!");
    SetCameraBehindPlayer(playerid);
    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - 300;
    return 1;
}
Код:
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - 300;



Re: Money Problems - Logofero - 22.08.2015

PHP код:
CMD:rescue(playeridparams[])
{
    if ((
GetPlayerState(playerid) == PLAYER_STATE_WASTED) || GetPlayerState(playerid) == PLAYER_STATE_NONE) return 0;
    if(
GetPlayerTeam(playerid) == TEAM_TRUCKER)
    {
       new 
rand random(sizeof(TruckerSpawn));
       
SetPlayerPos(playeridTruckerSpawn[rand][SpawnX], TruckerSpawn[rand][SpawnY], TruckerSpawn[rand][SpawnZ]);
       
SetPlayerFacingAngle(playeridTruckerSpawn[rand][SpawnAngle]);
    }
    if(
GetPlayerTeam(playerid) == TEAM_COP)
    {
       new 
rand random(sizeof(CopSpawn));
       
SetPlayerPos(playeridCopSpawn[rand][SpawnX], CopSpawn[rand][SpawnY], CopSpawn[rand][SpawnZ]);
       
SetPlayerFacingAngle(playeridCopSpawn[rand][SpawnAngle]);
    }
    
SetPlayerVirtualWorld(playerid1);
    
Loadingmap(playerid);
    
SendClientMessage(playeridCOLOUR_YELLOW"You been rescued!");
    
SetCameraBehindPlayer(playerid);
    
GivePlayerMoney(playerid, -300); // Add it work?
    //PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - 300;
    
return 1;




Re: Money Problems - DerickClark - 22.08.2015

Thank you, it's working now rep.