GivePlayerMoney
#1

How do i change to GivePlayerCash, because someone said if i do it, you'll get the money, right now you get the money like 1 sec then it go down where it was. :/
This is the error i get if i change "GivePlayerMoney" to "GivePlayerCash"
Код:
C:\Users\Jonte\Desktop\SAMPSERVER\filterscripts\bankrobbery.pwn(52) : error 017: undefined symbol "GivePlayerCash"
Код:
 #include <a_samp>
#include <zcmd>

#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_TWBLUE 0x0000FFAA

forward robtimer(playerid);
forward waittimer();

new robpossible;

public OnFilterScriptInit()
{

	robpossible = 1;
	return 1;
}

CMD:robbank(playerid, params[])
{
	if(robpossible == 1)
	{
		if(IsPlayerInRangeOfPoint(playerid, 3.0, 2309.1899,-8.4444,26.7422))
		{
		    robpossible = 0;
		    SetTimer("waittimer", 1200000, false);
		    SetTimer("robtimer", 240000, false);
		    
            SendClientMessage(playerid, COLOR_WHITE, "You gotta stay 2 minutes in the bank in order to rob it!");
            SendClientMessageToAll(COLOR_TWBLUE, "||----------------Latest News----------------||");
            SendClientMessageToAll(COLOR_GREEN, " Los Santos Bank Trust has Been Broken.");
            SendClientMessageToAll(COLOR_GREEN, " The Bank is Currentley getting Robbed. ");
            SendClientMessageToAll(COLOR_GREEN, " We will report more once we get more information.");
            SendClientMessageToAll(COLOR_TWBLUE, "||----------------Latest News----------------||");
		 }
	} else {
	    SendClientMessage(playerid, COLOR_WHITE, "You can't rob the bank right now!");
	}
	return 1;
}

public robtimer(playerid)
{
        if(!IsPlayerInRangeOfPoint(playerid, 4.0, 2309.1899,-8.4444,26.7422))
        {
         SendClientMessage(playerid, -1, "You failed to rob the bank!");
         return 1;
         }
    new string[128];
    new cash = random(200000);
    GivePlayerMoney(playerid, cash);

    format(string, sizeof(string), "You have successfully robbed $%d from the bank!", cash);
    SendClientMessage(playerid, COLOR_WHITE, string);
}

public waittimer()
{
	robpossible = 1;
	SendClientMessageToAll(COLOR_WHITE, "The bank is now available for robbery!");
}
Reply
#2

Removed.
Reply
#3

Removed.
Reply
#4

Its because there is no such things as GivePlayerCash.
You will need to add
pawn Код:
stock GivePlayerCash(playerid, money)
{
    GivePlayerMoney(playerid,money);
    return 1;
}
Then replace all GivePlayerMoney in your script to GivePlayerCash except ^ code.
Reply
#5

Quote:
Originally Posted by Isolated
Посмотреть сообщение
GivePlayerCash is usually implemented by self-made anticheats. You then
pawn Код:
#define GivePlayerMoney GivePlayerCash


SetPlayerMoney eh?
Uhh.. not scripted for a while.
Reply
#6

Код:
 stock GivePlayerCash(playerid, money)
{
    GivePlayerMoney(playerid,money);
    return 1;
}
It didn't work
Reply
#7

Quote:
Originally Posted by ScriptFohLife
Посмотреть сообщение
Код:
 stock GivePlayerCash(playerid, money)
{
    GivePlayerMoney(playerid,money);
    return 1;
}
It didn't work
try this

PHP код:
stock GivePlayerCash(playeridamount)
{
    
GivePlayerMoney(playeridamount);//GivePlayerCash(playerid, 2000); // sets
    
return 1;

PHP код:
other funtion as amount
GivePlayerMoney
(playerid, -amount); //GivePlayerCash(playerid, -2000); 
Reply
#8

Quote:
Originally Posted by UserName31
Посмотреть сообщение
try this

PHP код:
stock GivePlayerCash(playeridamount)
{
    
GivePlayerMoney(playeridamount);
    return 
1;

That didn't even change a thing. When a compiler converts variable names the name would never matter. It could be "somevarthatdoesntevenmatteranywaysbecauseigetconv erted".
Reply
#9

Quote:
Originally Posted by Isolated
Посмотреть сообщение
That didn't even change a thing. When a compiler converts variable names the name would never matter. It could be "somevarthatdoesntevenmatteranywaysbecauseigetconv erted".
yea its basicly same thing but at least try
&& it worked fine with me

PHP код:
cmd(cashplayeridparams[])
{
    
GivePlayerCash(playerid, -100);
    return 
1;
}
cmd(cash2playeridparams[])
{
    
GivePlayerCash(playerid100);
    return 
1;
}
stock GivePlayerCash(playeridamount)
{
    
GivePlayerMoney(playeridamount);//GivePlayerCash(playerid, 2000); // sets - +
    
return 1;

Reply
#10

Quote:
Originally Posted by UserName31
Посмотреть сообщение
try this

PHP код:
stock GivePlayerCash(playeridamount)
{
    
GivePlayerMoney(playeridamount);//GivePlayerCash(playerid, 2000); // sets
    
return 1;

PHP код:
other funtion as amount
GivePlayerMoney
(playerid, -amount); //GivePlayerCash(playerid, -2000); 
Wow, just space wouldn't take any effect...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)