[HELP] Can you see any errors on this cmd?
#1

Well, I dont get any errors while compiling this, but when I get to the PlayerToPoint and types /clothes it dont work.

Код:
if(strcmp(cmd, "/clothes", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {  new level;
	    level = strval(tmp);
			if(level > 299 || level < 1) { return 1; }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, 0xC0C0C0FF, "USAGE: /clothes [skin id]");
				return 1;
			}
			if(PlayerToPoint(1,playerid,217.5215,-98.3179,1005.2578))
			  {    GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
					  PlayerInfo[playerid][pChar] = level;
						format(string, sizeof(string), "You have changed your clothes",level);
						SendClientMessage(playerid, 0xFFFFFFFF, string);
					  SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
					}
			}
			else
			{
				SendClientMessage(playerid, 0xC0C0C0FF, "  you are not at the clothes shop!");
			}

		return 1;
	}
	return 0;
}
If I type /clothes anywhere it dont work, no reaction...

Thanks
Reply
#2

format(string, sizeof(string), "You have changed your clothes",level);
SendClientMessage(playerid, 0xFFFFFFFF, string);
SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
} // one } to many, it thinks the if statement is done...
}
else
{
SendClientMessage(playerid, 0xC0C0C0FF, " you are not at the clothes shop!");
}
Reply
#3

SetPlayerSkin?
Reply
#4

Quote:
Originally Posted by euRo`
SetPlayerSkin?
Yes, never heard of it?
Reply
#5

Quote:
Originally Posted by FreddeN
Quote:
Originally Posted by euRo`
SetPlayerSkin?
Yes, never heard of it?
wtf?? your using it in your code:

Код:
SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
you realy do have one } to many in your code.... !
Reply
#6

(Ignoring the identation)

this would work, with one brace less:

Код:
if(strcmp(cmd, "/clothes", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {  new level;
	    level = strval(tmp);
			if(level > 299 || level < 1) { return 1; }
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, 0xC0C0C0FF, "USAGE: /clothes [skin id]");
				return 1;
			}
			if(PlayerToPoint(1,playerid,217.5215,-98.3179,1005.2578))
			  {    GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
					  PlayerInfo[playerid][pChar] = level;
						format(string, sizeof(string), "You have changed your clothes",level);
						SendClientMessage(playerid, 0xFFFFFFFF, string);
					  SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
			}
			else
			{
				SendClientMessage(playerid, 0xC0C0C0FF, "  you are not at the clothes shop!");
			}

		return 1;
	}
	return 0;
}
Reply
#7

Quote:
Originally Posted by ExoSanty
Quote:
Originally Posted by FreddeN
Quote:
Originally Posted by euRo`
SetPlayerSkin?
Yes, never heard of it?
wtf?? your using it in your code:

Код:
SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]);
you realy do have one } to many in your code.... !
Alright, but I need clear answers, you know it yourself if I delete the selected } the command will just go nuts :P
So, how do you recommend me to deal with the situation?
Reply
#8

what do you mean nuts?

get errors while compiling, show them...
Reply
#9

Quote:
Originally Posted by ExoSanty
what do you mean nuts?

get errors while compiling, show them...
Well, by removing a } in the middle of the command it will look like this you know...

Код:
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(160) : error 017: undefined symbol "strtok"
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(160) : error 033: array must be indexed (variable "cmd")
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(174) : error 079: inconsistent return types (array & non-array)
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(176) : error 017: undefined symbol "strtok"
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(176) : error 033: array must be indexed (variable "tmp")
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(180) : error 079: inconsistent return types (array & non-array)
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(183) : error 004: function "String" is not implemented
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(184) : error 004: function "OnPlayerLogin" is not implemented
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(186) : error 079: inconsistent return types (array & non-array)
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(191) : error 017: undefined symbol "strtok"
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(191) : error 033: array must be indexed (variable "tmp")
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(195) : error 079: inconsistent return types (array & non-array)
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(200) : error 079: inconsistent return types (array & non-array)
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(204) : error 004: function "String" is not implemented
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(212) : error 079: inconsistent return types (array & non-array)
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(227) : error 004: function "OnPlayerLogin" is not implemented
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(228) : error 079: inconsistent return types (array & non-array)
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(235) : error 079: inconsistent return types (array & non-array)
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(243) : error 079: inconsistent return types (array & non-array)
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(244) : error 017: undefined symbol "strtok"
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(244) : error 033: array must be indexed (variable "tmp")
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(248) : error 079: inconsistent return types (array & non-array)
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(250) : error 004: function "PlayerToPoint" is not implemented
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(264) : warning 217: loose indentation
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(264) : error 079: inconsistent return types (array & non-array)
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(266) : warning 217: loose indentation
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(266) : error 079: inconsistent return types (array & non-array)
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(269) : warning 217: loose indentation
C:\Program\Rockstar Games\GTA San Andreas\server\gamemodes\test.pwn(269)
Reply
#10

and you dont get these errors with the brace there ?

if so, then i suggest you place that second brace afer your else statement

kind of wierd... could you show the entire public function?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)