#define startmoney 50000 -
NviDa - 17.04.2015
I added
Code:
#define StartMoney 50000
on top my script but it doesn't show up in game.
What should I do?
Re: #define startmoney 50000 -
ATGOggy - 17.04.2015
Are you new to Pawn?
If you are new, you need to learn Pawn. You need to learn about defines, functions and callbacks. Anyway, I'll give you the code for what you want:
PHP Code:
public OnPlayerConnect(playerid)
{
GivePlayerMoney(playerid, 50000);
return 1;
}
Re: #define startmoney 50000 -
JaydenJason - 17.04.2015
Quote:
Originally Posted by ATGOggy
Are you new to Pawn?
If you are new, you need to learn Pawn. You need to learn about defines, functions and callbacks. Anyway, I'll give you the code for what you want:
PHP Code:
public OnPlayerConnect(playerid)
{
GivePlayerMoney(playerid, 50000);
return 1;
}
|
more like
PHP Code:
public OnPlayerConnect(playerid)
{
GivePlayerMoney(playerid, StartMoney);
return 1;
}
Re: #define startmoney 50000 -
Denis1 - 17.04.2015
#define is a text replacement directive. For instance, if you have at the top of your script the following line:
Code:
#define StartMoney (5000)
instead of using:
Code:
public OnPlayerConnect(playerid)
{
GivePlayerMoney(playerid, 5000);
}
you may use:
Code:
public OnPlayerConnect(playerid)
{
GivePlayerMoney(playerid, StartMoney);
}
Same results.
Re: #define startmoney 50000 -
Darrenr - 17.04.2015
There some greats tutorials on the samp forum somewhere about Pre-Processor and macros... goes through defining constants and all that sorta stuff...
Re: #define startmoney 50000 -
ATGOggy - 17.04.2015
The problem is that he thought if he did something like #define Startmoney 50000, all players will get $50000 when they connect. He needs to learn the basic. He thought he can do it like we give info in server.cfg.
Re: #define startmoney 50000 -
R0 - 17.04.2015
yea,exactly like atoggy said,he got it wrong,by the way use this:
pawn Code:
public OnPlayerConnect(playerid)
{
GivePlayerMoney(playerid, StartMoney);
}
Re: #define startmoney 50000 -
MarikAshtar - 17.04.2015
And since noone else told you, these codes will give you 50k each time you connect, so if you save a players cash upon exit he will go 50k+ each time he connects.
Re: #define startmoney 50000 -
ATGOggy - 17.04.2015
Quote:
Originally Posted by MarikAshtar
And since noone else told you, these codes will give you 50k each time you connect, so if you save a players cash upon exit he will go 50k+ each time he connects.
|
He don't know the basics so there is no way that he would be having a user system.
Re: #define startmoney 50000 -
NviDa - 17.04.2015
Whoa wait ,calm please -.-
I know the basics, I just forgot about adding it on 'OnPlayerConnect' ..I just realized it now reading the comments.
Careless .