OnPlayerRegister(playerid, WP_Hash(tmppass, sizeof(tmppass), params));
C:\Documents and Settings\Administrator\Desktop\SAMPSERVER\gamemodes\admTstSvr.pwn(469) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Administrator\Desktop\SAMPSERVER\gamemodes\admTstSvr.pwn(495) : error 035: argument type mismatch (argument 2)
dcmd_login(playerid, params[])
{
new
tmppass[128],
plname[24],
string[128];
if(AccountInfo[playerid][Logged] == 1) return SendClientMessage(playerid, RED, "You are already logged in.");
if(!sscanf(params, "i", tmppass))
{
SendClientMessage(playerid, ORANGE, "Error! Use /login password!");
}
else
{
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "/Accounts/%s.playerAccount", plname);
if(!fexist(string)) return SendClientMessage(playerid, RED, "That account isn't registered! Please register: /register [password]");
strmid(tmppass, params, 0, strlen(params), 255);
OnPlayerLogin(playerid, WP_Hash(tmppass, sizeof(tmppass), params)); //line 495
return true;
}
return true;
}
dcmd_register(playerid, params[])
{
{
new
sendername[24],
string[64];
if(IsPlayerConnected(playerid))
{
if(AccountInfo[playerid][Logged] == 1)
{
SendClientMessage(playerid, RED, "You are already logged in.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 64, "/Accounts/%s.playeraccount", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, RED, "That name is already taken. Please reconnect using a different username.");
fclose(hFile);
return 1;
}
new tmppass[128];
if(!sscanf(params, "i", tmppass))
{
SendClientMessage(playerid, ORANGE, "Error! Use /register password");
}
else
{
strmid(tmppass, params, 0, strlen(params), 255);
OnPlayerRegister(playerid, WP_Hash(tmppass, sizeof(tmppass), params)); //line 469
}
return true;
}
return true;
}
}
forward OnPlayerRegister(playerid, password[]);
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new name[24], str[128], ip[15];
GetPlayerName(playerid, name, sizeof name);
GetPlayerIp(playerid, ip, sizeof ip);
format(str, sizeof str, "/Accounts/%s.playerAccount", name);
new File:account = fopen(str, io_write);
if (account)
{
strmid(AccountInfo[playerid][Password], password, 0, strlen(password), 255);
AccountInfo[playerid][Cash] = GetPlayerMoney(playerid);
new file[128];
{
format(file, sizeof file, "Password: %s\n\r", AccountInfo[playerid][Password]);
{ fwrite(account, file); }
format(file, sizeof file, "AdminLevel: %d\n\r", 0);
{ fwrite(account, file); AccountInfo[playerid][AdminLevel] = 0; }
format(file, sizeof file, "Cash: %d\n\r", AccountInfo[playerid][Cash]);
{ fwrite(account, file); }
format(file, sizeof file, "IPAddress: %s\n\r",ip);
{ fwrite(account, file); }
}
fclose(account);
SendClientMessage(playerid, GREEN, "|- Account successfully registered. You can now login ( /login [password] ) -|");
}
}
return 1;
}
forward OnPlayerLogin(playerid, password[]);
public OnPlayerLogin(playerid, password[])
{
new name[24], str[128];
GetPlayerName(playerid, name, sizeof name);
format(str, sizeof str, "/Accounts/%s.playeraccount", name);
new File:account = fopen(str, io_read);
if (account)
{
new pass[256];
new passres[128], value[128];
fread(account, pass, sizeof pass);
passres = GetFileString(pass);
if (!strcmp("Password", passres))
{
value = GetFileValue(pass);
strmid(AccountInfo[playerid][Password], value, 0, strlen(value)-1, 128);
}
if (!strcmp(AccountInfo[playerid][Password], password, true))
{
while (fread(account, pass, 256))
{
passres = GetFileString(pass);
if (strfind(passres, "AdminLevel") != -1)
{
value = GetFileValue(pass);
AccountInfo[playerid][AdminLevel] = strval(value);
}
if (strfind(passres, "Cash") != -1)
{
value = GetFileValue(pass);
AccountInfo[playerid][Cash] = strval(value);
}
}
fclose(account);
AccountInfo[playerid][Logged] = 1;
}
else
{
SendClientMessage(playerid, RED, "Incorrect Password.");
fclose(account);
return 1;
}
GivePlayerMoney(playerid, AccountInfo[playerid][Cash]);
format(str, sizeof str, "|- You have successfully logged in as %s -|", name);
SendClientMessage(playerid, GREEN, str);
printf("%s has logged in", name);
if (AccountInfo[playerid][AdminLevel] > 0)
{
format(str, sizeof str, "|» You are now logged in as a level %d admin «|", AccountInfo[playerid][AdminLevel]);
SendClientMessage(playerid, LIGHTGREEN, str);
}
}
return 1;
}
enum Info
{
AdminLevel,
Password[128],
Cash,
Logged,
Mute,
IP[20],
};
Originally Posted by Hiitchy - Oui, tu comprends?
*bump after 12h*
Anyone think they can help? |
dcmd_login(playerid, params[])
{
new
tmppass[128],
plname[24],
string[128];
if(AccountInfo[playerid][Logged] == 1) return SendClientMessage(playerid, RED, "You are already logged in.");
if(!sscanf(params, "i", tmppass))
{
SendClientMessage(playerid, ORANGE, "Error! Use /login password!");
}
else
{
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "/Accounts/%s.playerAccount", plname);
if(!fexist(string)) return SendClientMessage(playerid, RED, "That account isn't registered! Please register: /register [password]");
strmid(tmppass, params, 0, strlen(params), 255);
WP_Hash(tmppass, sizeof(tmppass), params);
OnPlayerLogin(playerid, tmppass); //line 495
return true;
}
return true;
}
dcmd_register(playerid, params[])
{
{
new
sendername[24],
string[64];
if(IsPlayerConnected(playerid))
{
if(AccountInfo[playerid][Logged] == 1)
{
SendClientMessage(playerid, RED, "You are already logged in.");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 64, "/Accounts/%s.playeraccount", sendername);
new File: hFile = fopen(string, io_read);
if (hFile)
{
SendClientMessage(playerid, RED, "That name is already taken. Please reconnect using a different username.");
fclose(hFile);
return 1;
}
new tmppass[128];
if(!sscanf(params, "i", tmppass))
{
SendClientMessage(playerid, ORANGE, "Error! Use /register password");
}
else
{
strmid(tmppass, params, 0, strlen(params), 255);
WP_Hash(tmppass, sizeof(tmppass), params);
OnPlayerRegister(playerid, tmppass); //line 469
}
return true;
}
return true;
}
}
---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3a R4, ©2005-2009 SA-MP Team [12:00:07] [12:00:07] Server Plugins [12:00:07] -------------- [12:00:07] Loaded 0 plugins. [12:00:07] [12:00:07] Ban list [12:00:07] -------- [12:00:07] Loaded: samp.ban [12:00:07] [12:00:07] [12:00:07] Filter Scripts [12:00:07] --------------- [12:00:07] Loading filter script 'towtruckScript.amx'... [12:00:07] Tow truck Script loaded [12:00:07] Loading filter script 'creatingCar_FS.amx'... [12:00:07] Car creation Filterscript! Created by Hiitchy - Tu comprends pas? [12:00:07] Re-distribution of this filterscript is allowed! [12:00:07] No copyrights or credits. [12:00:07] Loaded 2 filter scripts. [12:00:07] Script[gamemodes/admTstSvr.amx]: Run time error 19: "File or function is not found" [12:00:07] Number of vehicle models: 0
Originally Posted by pen_†ĥęGun
You need this PlugIn
http://forum.sa-mp.com/index.php?topic=89418.0 |