Script money on join
#1

Hello guys

I'm very new in scripting a SAMP server.
I really can't figure out how i can script that people who join for first on my server get money, for example 2000 bucks.
I ******d for scripts for hours, but i couldn't find one.

I'm sorry this sounds so noob, but i really can't figure this out.
I will appreciate it a lot if someone would post a simple script to do this.

Thank you guys!

Michiel
Reply
#2

pawn Код:
public OnPlayerConnect(playerid)
{
    if(Registered[playerid] == 0) //The player is not registered
    {
        ResetPlayerMoney(playerid);
        GivePlayerMoney(playerid, 2000);
    }
    return 1;
}
Reply
#3

Thank you a lot!
Reply
#4

When hitting F5, i'm getting this.
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(63) : error 029: invalid expression, assumed zero
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(63) : error 021: symbol already defined: "OnPlayerConnect"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#5

You've got the OnPlayerConnect callback
pawn Код:
public OnPlayerConnect(playerid)
twice in your script.
Reply
#6

Ok, fixed that, but now i'm getting this.
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(62) : error 017: undefined symbol "Registered"
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(62) : warning 215: expression has no effect
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(62) : error 001: expected token: ";", but found "]"
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(62) : error 029: invalid expression, assumed zero
C:\Users\Michiel\Servers\GTA sa\Gta test\gamemodes\test.pwn(62) : fatal error 107: too many error messages on one line
Reply
#7

Oh, you actually want us to make you a register system?
Try this: https://sampforum.blast.hk/showthread.php?tid=120724
Reply
#8

if the player not registred

Код:
public OnPlayerConnect(playerid)

 {
     
     GivePlayerMoney(playerid,2000);
  
  return 1;
}
Reply
#9

GivePlayerMoney(playerid,2000);?
Reply
#10

Thanks guys.
I installed the login/register system, and it works.
But i'm still having this error.

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

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

With this code

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


Forum Jump:


Users browsing this thread: 2 Guest(s)