/setname < 5 errors I don't understand
#1

I don't understand what I'm doing wrong...
Errors;
Код:
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(2390) : error 029: invalid expression, assumed zero
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(2393) : error 001: expected token: "-string end-", but found "-identifier-"
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(2393) : error 029: invalid expression, assumed zero
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(2393) : warning 215: expression has no effect
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(2393) : error 001: expected token: ";", but found ")"
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(2393) : fatal error 107: too many error messages on one line

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


5 Errors.
pawn Код:
dcmd_setname(playerid, params[])
{
  if(pInfo[playerid][pAdmin] < 5) return SystemMessage(playerid, "You are not an Administrator with the required level.");
  {
    new id, newname[24];
    if(sscanf(params, "ds", id, newname)) // Usage Message
    else
    {
      new str[24];
      format(str, 24, "%s". newname));
      SetPlayerName(id, str);
        format(myString,sizeof(myString),"You have changed %s's name to %s",myPlayerName, newname);
            SystemMessage(playerid, myString);
            format(myString,sizeof(myString),"Your name has been changed by Adminstrator %s to $s",adminname, newname);
    }
  }
  return 1;
}
Could someone help?
Reply
#2

And line 2390 & 2393 is where...?
Reply
#3

Код:
 if(sscanf(params, "ds", id, newname)) // Usage Message
    else
... is an invalid expression. Either use

Код:
else if(sscanf(params, "ds", id, newname))
or

Код:
if(sscanf(params, "ds", id, newname))
{
// some code
}
else
depending on what you want.
Reply
#4

Quote:
Originally Posted by [03
Garsino ]
And line 2390 & 2393 is where...?
pawn Код:
format(str, 24, "%s". newname));
Reply
#5

The "." is incorrect as well, should be a ",".

Код:
format(str, 24, "%s", newname));
Reply
#6

Quote:
Originally Posted by ray187
The "." is incorrect as well, should be a ",".

Код:
format(str, 24, "%s", newname));
That gives me even more errors!
Reply
#7

pawn Код:
format(str, 24, "%s", newname);
You had 1 ")" too much
Reply
#8

Quote:
Originally Posted by [03
Garsino ]
pawn Код:
format(str, 24, "%s", newname);
You had 1 ")" too much
New errors (don't understand)...

Код:
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(2418) : error 017: undefined symbol "myString"
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(2418) : error 017: undefined symbol "myString"
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(2418) : error 029: invalid expression, assumed zero
D:\DOCUME~1\ANDY~1\MYDOC~1\_UF_SF~1\GAMEMO~1\_UF_SF~1.PWN(2418) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#9

Time for you to read through documentary or googling your errors instead of asking here for every little bit.

The errors are literally telling you whats wrong.
Reply
#10

Quote:
Originally Posted by ray187
Time for you to read through documentary or googling your errors instead of asking here for every little bit.
I'm always doing that before posting my errors (I shouldn't be saying "I don't understand those errors").
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)