Hello I have problems with command converting.... Please help
#1

Код:
error 017: undefined symbol "tmp"
error 017: undefined symbol "cmdtext"
error 017: undefined symbol "tmp"
error 017: undefined symbol "tmp"
error 017: undefined symbol "tmp"
error 017: undefined symbol "cmdtext"
error 017: undefined symbol "string"
error 017: undefined symbol "string"
warning 215: expression has no effect
error 001: expected token: ";", but found "]"
fatal error 107: too many error messages on one line
Код:
CMD:spam(playerid,params[])
{
	if(AccInfo[playerid][Level] >= 5)
	{
 		tmp = strtok(cmdtext, idx);//this line first 2 errors
		if(!strlen(tmp))//next error
		{
			SendClientMessage(playerid, LIGHTBLUE2, "Usage: /spam [Colour] [Text]");
			SendClientMessage(playerid, orange, "Colours: [0]Black, [1]White, [2]Red, [3]Orange, [4]Yellow, [5]Green, [6]Blue, [7]Purple, [8]Brown, [9]Pink");
   			SendClientMessage(playerid, orange, "Function: Will sending many messages in chat in specified Colour");
			return 1;
		}
		new Colour = strval(tmp);//This error
		if(Colour > 9 )
		return SendClientMessage(playerid, red, "Colours: [0]Black, [1]White, [2]Red, [3]Orange, [4]Yellow, [5]Green, [6]Blue, [7]Purple, [8]Brown, [9]Pink");
		tmp = strtok(cmdtext, idx);//next 2 errors!!

		format(string,sizeof(string),"%s",cmdtext[8]);//next 5 errors!! 

		if(Colour == 0) 	 for(new i; i < 50; i++) SendClientMessageToAll(black,string);
		else if(Colour == 1) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_WHITE,string);
	 	else if(Colour == 2) for(new i; i < 50; i++) SendClientMessageToAll(red,string);
 	   	else if(Colour == 3) for(new i; i < 50; i++) SendClientMessageToAll(orange,string);
     	else if(Colour == 4) for(new i; i < 50; i++) SendClientMessageToAll(yellow,string);
 	   	else if(Colour == 5) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_GREEN1,string);
 	  	else if(Colour == 6) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_BLUE,string);
  	 	else if(Colour == 7) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_PURPLE,string);
    	else if(Colour == 8) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_BROWN,string);
    	else if(Colour == 9) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_PINK,string);
		return 1;
	}
	else return ErrorMessages(playerid, 9);
}
Please help me out with this
Reply
#2

Just add these on the top of the command
pawn Код:
CMD:spam(playerid,params[])
{
   new tmp;
   new string[128];
}
For Cmdtext, don't know :\
Reply
#3

Thanks for that Just need to think whats the next errors.. but anyway + rep
Reply
#4

replace cmdtext with params
Reply
#5

Yeah thanks all done thanks mates for helping me out.. Just I love ****** and good persons
Reply
#6

It's okay, anytime
Reply
#7

Well if you are using sscanf maybe like this?

Код:
CMD:spam(playerid,params[])
{
	if(AccInfo[playerid][Level] >= 5)
	{
		if(sscanf(params, "is[128]",Colour,text))
		{
			SendClientMessage(playerid, LIGHTBLUE2, "Usage: /spam [Colour] [Text]");
			SendClientMessage(playerid, orange, "Colours: [0]Black, [1]White, [2]Red, [3]Orange, [4]Yellow, [5]Green, [6]Blue, [7]Purple, [8]Brown, [9]Pink");
   			SendClientMessage(playerid, orange, "Function: Will sending many messages in chat in specified Colour");
			return 1;
		}
		if(Colour > 9 )
		return SendClientMessage(playerid, red, "Colours: [0]Black, [1]White, [2]Red, [3]Orange, [4]Yellow, [5]Green, [6]Blue, [7]Purple, [8]Brown, [9]Pink");
		new str[128];
		format(string,sizeof(string),"%s",text);/

		if(Colour == 0) 	 for(new i; i < 50; i++) SendClientMessageToAll(black,string);
		else if(Colour == 1) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_WHITE,string);
	 	else if(Colour == 2) for(new i; i < 50; i++) SendClientMessageToAll(red,string);
 	   	else if(Colour == 3) for(new i; i < 50; i++) SendClientMessageToAll(orange,string);
     	else if(Colour == 4) for(new i; i < 50; i++) SendClientMessageToAll(yellow,string);
 	   	else if(Colour == 5) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_GREEN1,string);
 	  	else if(Colour == 6) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_BLUE,string);
  	 	else if(Colour == 7) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_PURPLE,string);
    	else if(Colour == 8) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_BROWN,string);
    	else if(Colour == 9) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_PINK,string);
		return 1;
	}
	else return ErrorMessages(playerid, 9);
}
if not sorry for posting
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)