#define startmoney 50000
#1

I added
Code:
 #define StartMoney 50000
on top my script but it doesn't show up in game.
What should I do?
Reply
#2

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(playerid50000);
    return 
1;

Reply
#3

Quote:
Originally Posted by ATGOggy
View Post
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(playerid50000);
    return 
1;

more like

PHP Code:
public OnPlayerConnect(playerid)
{
    
GivePlayerMoney(playeridStartMoney);
    return 
1;

Reply
#4

#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.
Reply
#5

There some greats tutorials on the samp forum somewhere about Pre-Processor and macros... goes through defining constants and all that sorta stuff...
Reply
#6

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.
Reply
#7

yea,exactly like atoggy said,he got it wrong,by the way use this:
pawn Code:
public OnPlayerConnect(playerid)
{
    GivePlayerMoney(playerid, StartMoney);
}
Reply
#8

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.
Reply
#9

Quote:
Originally Posted by MarikAshtar
View Post
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.
Reply
#10

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 .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)