[Roadblock]Help
#1

Hello EverY One
i Have Problems With RoadBlock
See Error.
Quote:

D:\ffff\gamemodes\textdraws.pwn(2185) : error 017: undefined symbol "tmp"
D:\ffff\gamemodes\textdraws.pwn(2185) : error 017: undefined symbol "strtok"
D:\ffff\gamemodes\textdraws.pwn(2186) : error 017: undefined symbol "tmp"
D:\ffff\gamemodes\textdraws.pwn(2196) : error 017: undefined symbol "tmp"
D:\ffff\gamemodes\textdraws.pwn(2204) : error 017: undefined symbol "string"
D:\ffff\gamemodes\textdraws.pwn(2204) : error 017: undefined symbol "string"
D:\ffff\gamemodes\textdraws.pwn(2204) : error 029: invalid expression, assumed zero
D:\ffff\gamemodes\textdraws.pwn(2204) : fatal error 107: too many error messages on one line

line 2185
PHP код:
tmp strtok(cmdtextidx); 
line 2186
PHP код:
if(!strlen(tmp)) 
line 2196
PHP код:
new rb strval(tmp); 
line 2204
PHP код:
format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(1) at his position, over.",GPN(playerid)); 
all the command
PHP код:
CMD:roadblock(playeridparams[])
{
        if(
gTeam[playerid] == TEAM_SWAT)
         {
            
tmp strtok(cmdtextidx);
            if(!
strlen(tmp))
            {
                
SendClientMessage(playeridCOLOR_YELLOW"USAGE: /crb [Roadblock ID]");
                
SendClientMessage(playeridCOLOR_LIGHTBLUE"Available Roadblocks:");
                
SendClientMessage(playeridCOLOR_GREEN"| 1: Small Roadblock");
                
SendClientMessage(playeridCOLOR_GREEN"| 2: Medium Roadblock");
                
SendClientMessage(playeridCOLOR_GREEN"| 3: Big Roadblock");
                
SendClientMessage(playeridCOLOR_GREEN"| 3: Cone");
                return 
1;
            }
            new 
rb strval(tmp);
            if (
rb == 1)
            {
                
PlayerPlaySound(playerid10520.00.00.0);
                new 
Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                
GetPlayerPos(playeridplocxplocyplocz);
                
GetPlayerFacingAngle(playerid,ploca);
                
CreateRoadblock(1459,plocx,plocy,plocz,ploca);
                
format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(1) at his position, over.",GPN(playerid));
                
SendRadioMessage(1,COLOR_BLUE,string);
                
GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
                return 
1;
            }
            else if (
rb == 2)
            {
                
PlayerPlaySound(playerid10520.00.00.0);
                new 
Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                
GetPlayerPos(playeridplocxplocyplocz);
                
GetPlayerFacingAngle(playerid,ploca);
                
CreateRoadblock(978,plocx,plocy,plocz+0.6,ploca);
                
format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(2) at his position, over.",GPN(playerid));
                
SendRadioMessage(1,COLOR_BLUE,string);
                
GameTextForPlayer(playerid,"~w~Roadblock ~b~Placed!",3000,1);
                return 
1;
            }
            else if (
rb == 3)
            {
                
PlayerPlaySound(playerid10520.00.00.0);
                new 
Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                
GetPlayerPos(playeridplocxplocyplocz);
                
GetPlayerFacingAngle(playerid,ploca);
                
CreateRoadblock(981,plocx,plocy,plocz+0.9,ploca+180);
                
format(string,sizeof(string),"[HQ]: Officer %s has placed a Roadblock(3) at his position, over.",GPN(playerid));
                
SendRadioMessage(1,COLOR_BLUE,string);
                
GameTextForPlayer(playerid,"~w~Roadblock ~g~Placed!",3000,1);
                
SetPlayerPos(playeridplocxplocy+1.3plocz);
                return 
1;
            }
            else if (
rb == 4)
            {
                
PlayerPlaySound(playerid10520.00.00.0);
                new 
Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                
GetPlayerPos(playeridplocxplocyplocz);
                
GetPlayerFacingAngle(playerid,ploca);
                
CreateRoadblock(1238,plocx,plocy,plocz+0.2,ploca);
                
format(string,sizeof(string),"[HQ]: Officer %s has placed a Traffic Cone(1) at his position, over.",GPN(playerid));
                
SendRadioMessage(1,COLOR_BLUE,string);
                
GameTextForPlayer(playerid,"~w~Cone ~g~Placed!",3000,1);
                return 
1;
            }
            
/*else if (rb == 4)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(1425,plocx,plocy,plocz+0.6,ploca);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Detour Sign(4) at his position, over.",GPN(playerid));
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
                return 1;
            }
            else if (rb == 5)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(3265,plocx,plocy,plocz-0.5,ploca);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Will Be Sign(5) at his position, over.",GPN(playerid));
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
                return 1;
            }
            else if (rb == 6)
            {
                PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
                new Float:plocx,Float:plocy,Float:plocz,Float:ploca;
                GetPlayerPos(playerid, plocx, plocy, plocz);
                GetPlayerFacingAngle(playerid,ploca);
                CreateRoadblock(3091,plocx,plocy,plocz+0.5,ploca+180);
                format(string,sizeof(string),"[HQ]: Officer %s has placed a Line Closed Sign(6) at his position, over.",GPN(playerid));
                SendRadioMessage(1,COLOR_BLUE,string);
                GameTextForPlayer(playerid,"~w~Sign ~g~Placed!",3000,1);
                return 1;
            }*/
        
}
        return 
1;
    } 
Please Help+Rep
Reply
#2

Use sscanf to make life easy
Reply
#3

Replace line 2185 with this:
pawn Код:
new tmp = strtok(cmdtext, idx);
EDIT: As ryz said, use sscanf! It's easier and faster
Reply
#4

still error
Quote:

D:\ffff\gamemodes\textdraws.pwn(1035) : error 021: symbol already defined: "S@@_OnPlayerUpdate"
D:\ffff\gamemodes\textdraws.pwn(2186) : error 017: undefined symbol "cmdtext"
D:\ffff\gamemodes\textdraws.pwn(2186) : error 033: array must be indexed (variable "-unknown-")
D:\ffff\gamemodes\textdraws.pwn(2187) : error 035: argument type mismatch (argument 1)
D:\ffff\gamemodes\textdraws.pwn(2197) : error 035: argument type mismatch (argument 1)
D:\ffff\gamemodes\textdraws.pwn(2205) : error 017: undefined symbol "string"
D:\ffff\gamemodes\textdraws.pwn(2205) : error 017: undefined symbol "string"
D:\ffff\gamemodes\textdraws.pwn(2205) : error 029: invalid expression, assumed zero
D:\ffff\gamemodes\textdraws.pwn(2205) : fatal error 107: too many error messages on one line

Reply
#5

help please!
Reply
#6

Quote:
Originally Posted by astanalol
Посмотреть сообщение
still error
Dude you have defined onplayerupdate twice, delete one
Reply
#7

Quote:
Originally Posted by 1fret
Посмотреть сообщение
Dude you have defined onplayerupdate twice, delete one
dude i dont have it twice i searched and only 1 there
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)