[[[helpp]]] - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [[[helpp]]] (
/showthread.php?tid=267020)
[[[helpp]]] -
HayZatic - 06.07.2011
I Get These error Codes..
Код:
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\pawno\new.pwn(226) : error 017: undefined symbol "idcmd"
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\pawno\new.pwn(227) : error 017: undefined symbol "dcmd_login"
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\pawno\new.pwn(228) : error 017: undefined symbol "dcmd_logout"
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\pawno\new.pwn(229) : error 017: undefined symbol "dcmd_password"
C:\Documents and Settings\Chris\My Documents\HayZaticFreeRoam\pawno\new.pwn(412) : warning 203: symbol is never used: "dcmd_register"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
This is my Script
Код:
dcmd_register(playerid, params[])
{
if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)
return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You have already registered!");
else if(!params[0])
return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /register [password]");
/*else if(strlen(params) < gSettings[PASS_MIN] || strlen(params) > gSettings[PASS_MAX])
{
new string[128];
format(string, sizeof(string), "ERROR: Password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
return SendClientMessage(playerid, COLOUR_ORANGE, string);
}*/
else
{
new password = num_hash(params);
gPlayerInfo[playerid][PLAYER_PASS] = password;
gPlayerInfo[playerid][PLAYER_REGGED] = 1;
gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16);
new string[128]; format(string, sizeof(string), "You have successfully registered your account with the password \'%s\'. You have been automatically logged in.", params);
return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
}
dcmd_login(playerid, params[])
{
if(gPlayerInfo[playerid][PLAYER_REGGED] != 1)
return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must register first to do that! Use /register [password] to register and login.");
else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 1)
return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You are already logged-in.");
else if(!params[0])
return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /login [password]");
else
{
new password = num_hash(params);
if(gPlayerInfo[playerid][PLAYER_PASS] == password)
{
gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16);
return SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have successfully logged in to your account.");
}
else
return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password.");
}
}
Re: [[[helpp]]] -
grand.Theft.Otto - 06.07.2011
Remember to add your command name in dcmd form under OnPlayerCommandText. Like so:
pawn Код:
dcmd(login,5,cmdtext); // these numbers represent the command length
dcmd(logout,6,cmdtext);
dcmd(password,8,cmdtext);
dcmd(register,7,cmdtext);
Then remember to place the dcmd_login(playerid,params[]), etc... commands at the bottom of your script.