public OnPlayerCommandText(playerid, cmdtext[],params[]) { if (strcmp("/register", cmdtext, true, 10) == 0) { if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"{F81414}Your Already Registered!"); if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"{F81414}Your Registered But Not Logged In Type /login [password]"); if (strlen(params)==0) return SystemMsg(playerid,"{F81414}USAGE: /register [password]"); if (udb_Create(PlayerName(playerid),params)) { SystemMsg(playerid,"{6EF83C}Account Created! Now Use /login [password] To Login."); } } return 1; }
C:\Users\Stephen-Laptop\Desktop\Samp Stunt Server\filterscripts\regsystem.pwn(110) : error 025: function heading differs from prototype Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
Why would you change the function parameters - OnPlayerCommandText(playerid, cmdtext[],params[])?
The header of the function - OnPlayerCommandText is OnPlayerCommandText(playerid,cmdtext[]) |
C:\Users\Stephen-Laptop\Desktop\Samp Stunt Server\filterscripts\regsystem.pwn(118) : error 017: undefined symbol "params" C:\Users\Stephen-Laptop\Desktop\Samp Stunt Server\filterscripts\regsystem.pwn(119) : error 017: undefined symbol "params" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/register", cmdtext, true, 10) == 0) { if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"{F81414}Your Already Registered!"); if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"{F81414}Your Registered But Not Logged In Type /login [password]"); if (strlen(cmdtext)==0) return SystemMsg(playerid,"{F81414}USAGE: /register [password]"); if (udb_Create(PlayerName(playerid),cmdtext)) { SystemMsg(playerid,"{6EF83C}Account Created! Now Use /login [password] To Login."); } } return 1; }
You cannot modify predefined function headers simply because you get errors. When you get errors you have to blame yourself and try to correct your code rather than correcting the predefined ones.
And now for the error: Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/register", cmdtext, true, 10) == 0) { if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"{F81414}Your Already Registered!"); if (udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"{F81414}Your Registered But Not Logged In Type /login [password]"); if (strlen(cmdtext)==0) return SystemMsg(playerid,"{F81414}USAGE: /register [password]"); if (udb_Create(PlayerName(playerid),cmdtext)) { SystemMsg(playerid,"{6EF83C}Account Created! Now Use /login [password] To Login."); } } return 1; } |
You need to use strtok to extract the password the user types and if it doesnot exist then ask him to type. There are many registration systems in the forums. Grab a one using search and learn from it.
|
if (strlen(params)<4) return SendClientMessage(playerid,red,"Password length must be greater than three characters");