[Tutorial] How to make a register system - DIALOG
#61

can i delete the 'p'? like replace from this: pScore,pCash,pAdminLevel
to this:Score,Cash,AdminLevel
Reply
#62

Yes....
Reply
#63

Quote:
Originally Posted by SpiderWalk
View Post
Code:
C:\Documents and Settings\Korisnik\Desktop\G.R.P\gamemodes\RCRP.pwn(409) : warning 219: local variable "tmp" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
how to fix this?
you have to delete the new tmp at line 409

EDIT: I have noticed that OnPlayerDisconnect you need to replace this
dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
dini_IntSet(file, "Money",PlayerInfo[playerid][pMoney]);
with this:
dini_IntSet(file, "Score", GetPlayerScore(playerid));
dini_IntSet(file, "Money", GetPlayerMoney(playerid));

Because the money is not saving properly or it is not saving at all if you leave this.
Reply
#64

Code:
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(74) : error 017: undefined symbol "gPlayerLogged"
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(74) : warning 215: expression has no effect
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(74) : error 001: expected token: ";", but found "]"
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(74) : error 029: invalid expression, assumed zero
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(74) : fatal error 107: too many error messages on one line

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


4 Errors.
Code:
new PlayerInfo[MAX_PLAYERS] [pInfo];
new gPlayerLogged[MAX_PLAYERS];
They are on the top.
Reply
#65

Quote:
Originally Posted by Remba031
View Post
you have to delete the new tmp at line 409

EDIT: I have noticed that OnPlayerDisconnect you need to replace this
dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
dini_IntSet(file, "Money",PlayerInfo[playerid][pMoney]);
with this:
dini_IntSet(file, "Score", GetPlayerScore(playerid));
dini_IntSet(file, "Money", GetPlayerMoney(playerid));

Because the money is not saving properly or it is not saving at all if you leave this.
It's not a good idea to rely on GetPlayerMoney, otherwise you will have no defense against players hacking money. Any time you want to edit the amount of money the player has, use the GivePlayerMoney function paired with setting the player's pMoney variable.

For example, if you wanted to give the play $500 you would:

GivePlayerMoney(playerid, 500);
PlayerInfo[playerid][Money] += 500;

That way, it won't require much effort to make an anti-hack system in the future where you can compare a player's client money amount to that of their variable.
Reply
#66

What's wrong with this code:

Code:
public OnPlayerConnect(playerid)
{
	gPlayerLogged[playerid] = 0;
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if (!dini_Exists(file))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Khaos Register", "Welcome, You're not registered!, Register to play!", "Register", "Leave");
    }
    if(fexist(file))
    {
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Khaos Register", "Registered Complete. Now login", "Login", "Leave");
    }
}
I get this error:

Code:
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(80) : error 017: undefined symbol "gPlayerLogged"
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(80) : warning 215: expression has no effect
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(80) : error 001: expected token: ";", but found "]"
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(80) : error 029: invalid expression, assumed zero
C:\GTA Trucking Server\Test Script Server\gamemodes\khaos.pwn(80) : fatal error 107: too many error messages on one line

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


4 Errors.
Code:
new PlayerInfo[MAX_PLAYERS] [pInfo];
new gPlayerLogged[MAX_PLAYERS];
Reply
#67

Help me!
I am paste is script and compiling on pawno (and writed in server.cfg). But script is don't work.
I am connect on server and spawn...register system is don't work (I am don't edit script)!!!
Reply
#68

Can you be more specific? By the way, this was posted last year, why not upgrade to a newer system such as MySQL or Y_ini. Give SII a try
Reply
#69

1. Script in my server is don't work...As script is none.
2. I am don't edit script. It is as in post 1.
3. I don't can search other register system on SA-MP.
Help me.
Reply
#70

1. This system is out dated!
2. This thread was created on 14/08/2010, 09:15 PM
3. This thread is worthless due to having dini as the file writer
4. Use the search function, it will find you something
5. LOOK AT THE GOD DAMN COMMENTS AND TRY FIND WHAT HELP YOU REQUESTED.
Reply
#71

How do I add commands like /aduty on, /aduty off [For admins] and /admins [for players]?
Reply
#72

Quote:
Originally Posted by Cody9611
View Post
How do I add commands like /aduty on, /aduty off [For admins] and /admins [for players]?
I adore the search button, its free, and you should too!
Reply
#73

Thanks very much mate.

But first admin command will be good for making more admin cmds in this register system.

Please support that.

Thanks

Davz~
Reply
#74

You guys know this is highly outdated? I suggest using Y_INI
Reply
#75

oh my gosh thank you , i won't use the registering system , but i will try to understand how to use dini thanks alot Lorenc_
Reply
#76

No problem though you should really, really, really look at the SQLite tutorial I made, it's way better.
Reply
#77

i did all the steps... didnt save can you send me a tut or pm how to save it?
Reply
#78

Quote:
Originally Posted by noder51
View Post
i did all the steps... didnt save can you send me a tut or pm how to save it?
You created the folder "myserver" in scriptfiles?
Reply
#79

This is a nice tutorial
Reply
#80

New tutorial, now using up-to-date methods!

It's strongly suggested that everyone takes a look at this tutorial, help will be ignored and so will the thread be locked. The tutorial is clearly out-dated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)