SA-MP Forums Archive
Help with money code - 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: Help with money code (/showthread.php?tid=372567)



Help with money code - Natureforce - 27.08.2012

Hello guys

I use this code to give people who register on my server get 2000 dollars.

public OnPlayerConnect(playerid)
{
if(Registered[playerid] == 0) //The player is not registered
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, 2000);
}
return 1;
}


However, when i press F5 i get this error message:
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(30 : error 017: undefined symbol "Registered"
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(30 : warning 215: expression has no effect
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(30 : error 001: expected token: ";", but found "]"
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(30 : error 029: invalid expression, assumed zero
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(30 : fatal error 107: too many error messages on one line

I can't figure out what's wrong...

Greetings

Michiel


Re: Help with money code - xtreamer - 27.08.2012

public OnPlayerConnect(playerid)
{
if(PlayerInfo[playerid][pReg] == 0) //The player is not registered
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, 2000);
}
return 1;
}


Re: Help with money code - Natureforce - 27.08.2012

Still having the same error code.


Re: Help with money code - Ranama - 27.08.2012

Do you got any variable in your script that is named

Registered[MAX_PLAYERS];

Othervise you'll have to create one and define when it should be set to 1 etc.


Re: Help with money code - Natureforce - 27.08.2012

No, i haven't, where in my 'gamemode' do i put that?


Re: Help with money code - TheArcher - 27.08.2012

create the global variable:

pawn Код:
new Registred[MAX_PLAYERS];



Re: Help with money code - Natureforce - 27.08.2012

I did what you said, but now i'm having:

C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(400) : error 017: undefined symbol "PlayerInfo"
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(400) : warning 215: expression has no effect
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(400) : error 001: expected token: ";", but found "]"
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(400) : error 029: invalid expression, assumed zero
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(400) : fatal error 107: too many error messages on one line