5 Error Help please. - 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)
+--- Thread: 5 Error Help please. (
/showthread.php?tid=494908)
5 Error Help please. -
Clad - 15.02.2014
Solved.
Re: 5 Error Help please. -
Avi Raj - 15.02.2014
can u please add a text after line 4248 and 4247.
like
pawn Код:
................. // Line 4247
................. // Line 4248
Re: 5 Error Help please. -
Clad - 15.02.2014
While is line 4248
Re: 5 Error Help please. -
Avi Raj - 15.02.2014
and can i see line 4247?
Re: 5 Error Help please. -
Clad - 15.02.2014
Here you go
Код:
if(strcmp(cmd,"/register",true) == 0)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new cmd[256]
Line 4248 > while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
Re: 5 Error Help please. -
Avi Raj - 15.02.2014
Try this.
pawn Код:
if(strcmp(cmd,"/register",true) == 0)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new cmd[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
Re: 5 Error Help please. -
Clad - 15.02.2014
It gave me this
Код:
F:\TPG Roleplay\gamemodes\TPGSERVER.pwn(4218) : error 033: array must be indexed (variable "cmd")
F:\TPG Roleplay\gamemodes\TPGSERVER.pwn(4247) : warning 219: local variable "cmd" shadows a variable at a preceding level
F:\TPG Roleplay\gamemodes\TPGSERVER.pwn(4248) : error 017: undefined symbol "result"
F:\TPG Roleplay\gamemodes\TPGSERVER.pwn(4248) : error 029: invalid expression, assumed zero
F:\TPG Roleplay\gamemodes\TPGSERVER.pwn(4250) : error 017: undefined symbol "result"
F:\TPG Roleplay\gamemodes\TPGSERVER.pwn(4250) : warning 215: expression has no effect
F:\TPG Roleplay\gamemodes\TPGSERVER.pwn(4250) : error 001: expected token: ";", but found "]"
F:\TPG Roleplay\gamemodes\TPGSERVER.pwn(4250) : error 029: invalid expression, assumed zero
F:\TPG Roleplay\gamemodes\TPGSERVER.pwn(4250) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
7 Errors.
Re: 5 Error Help please. -
Avi Raj - 15.02.2014
result is not defined.
Re: 5 Error Help please. -
Clad - 15.02.2014
This is the whole command.
Код:
if(strcmp(cmd,"/register",true) == 0)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new cmd[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "[ ! ] USAGE: /register (password)");
return 1;
}
if (Logged[playerid] == 1) return scm(playerid,c_r,"[ ! ] Already Logged in !");
if (udb_Exists(PlayerName(playerid))) return scm(playerid,c_r,"[ ! ] Account already exists, please use '/login password'.");
new plrip[256];
GetPlayerIp(playerid,plrip,sizeof(plrip));
if (udb_Create(PlayerName(playerid),result))
{
SystemMsg(playerid,"[ ! ] Account successfully created. Login with '/login password' now.");
RemoveJob(playerid);
SetJob(playerid,9);
ResetPlayerRcash(playerid);
GivePlayerTec9(playerid,-GetPlayerTec9(playerid));
GivePlayerTec9B(playerid,-GetPlayerTec9B(playerid));
GivePlayerRcash(playerid, 25);
ResetPlayerAdminz(playerid);
SavePlayer(playerid);
clan = 255;
return 1;
}
return 1;
}