help with adding something
#1

Код HTML:
F:\Program Files\test\gamemodes\SATDM_1.pwn(60648) : error 003: declaration of a local variable must appear in a compound block
F:\Program Files\test\gamemodes\SATDM_1.pwn(60648) : error 091: ambiguous constant; tag override is required (symbol "name")
F:\Program Files\test\gamemodes\SATDM_1.pwn(60648) : warning 215: expression has no effect
F:\Program Files\test\gamemodes\SATDM_1.pwn(60648) : error 001: expected token: ";", but found "]"
F:\Program Files\test\gamemodes\SATDM_1.pwn(60648) : fatal error 107: too many error messages on one line

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


4 Errors.
PHP код:
CMD:loadmap(playerid,params[])
{
    if(
PlayerInfo[playerid][Level] >= 1)
    new 
name[128];
    if(
sscanf(params,"s[50]",name)) return SendClientMessage(playerid,RED,"Usage : /loadmap ""<filename>");
    
format(name,128,"Maps/%s.txt",NaMe);
    
LoadSAMPMap(playerid,name,1);
    return 
1;
}
CMD:deletemap(playerid,params[]) return cmd_removemap(playerid,params);
CMD:removemap(playerid,params[])
{
    if(
PlayerInfo[playerid][Level] >= 1)
    new 
name[128];
    if(
sscanf(params,"s[50]",name)) return SendClientMessage(playerid,RED,"Usage : /removemap ""<Map name>");
    
format(name,128,"Maps/%s",name);
    
RemoveMap(playerid,params);
    return 
1;
}
CMD:reloadmap(playerid,params[])
{
    if(
PlayerInfo[playerid][Level] >= 1)
    new 
name[128];
    if(
sscanf(params,"s[50]",name)) return SendClientMessage(playerid,RED,"Usage : /loadmap "_"<filename>");
    
format(name,128,"Maps/%s.txt",name);
       
RemoveMap(playerid,params);
    
LoadSAMPMap(playerid,name,1);
    return 
1;

Reply
#2

pawn Код:
format(name,128,"Maps/%s.txt",NaMe);
Just a hunch that's the line, change NaMe to name. If it isn't highlight the line. As the errors don't really tally to that.

You also haven't indented your if statements which would give you some of those errors, an IF should be

pawn Код:
if (...)
{
       code
}
Unless they have a direct return:

pawn Код:
if(...) return ...;
Reply
#3

pawn Код:
"Usage : /loadmap ""<filename>");
to
pawn Код:
"Usage : /loadmap <filename>");
Reply
#4

Quote:
Originally Posted by TakeiT
Посмотреть сообщение
pawn Код:
"Usage : /loadmap ""<filename>");
to
pawn Код:
"Usage : /loadmap <filename>");
You could explain that he can use the quotation marks inside a string too.

In that case he could do this:

pawn Код:
"Usage : /loadmap \"<filename>\" ");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)