28.07.2010, 15:59
Ok so I've got a command that is supposed to be like this:
COMMAND: /playername [ID]
and its supposed to respond like this:
RESPONSE: ID: [ID] | Player Name: [PLAYERNAME]
This is the code to do it:
But i cant figure out how to make it so it shows the Response, i have
As the response but i get an error saying:
I cant figure out how to combine strings with variables i used the plus oppertation but it is not correct. I get the error posted, when i try. How can i solve this issue?
COMMAND: /playername [ID]
and its supposed to respond like this:
RESPONSE: ID: [ID] | Player Name: [PLAYERNAME]
This is the code to do it:
pawn Код:
if (!strcmp("/playername", cmdtext, false, 11))
{
if(!cmdtext[11])return SendClientMessage(playerid,0xFF0000FF,"USAGE: /playername [ID]");
{
new str[128];
new name;
name = GetPlayerName(cmdtext[12],str,sizeof(str));
SendClientMessage(playerid,0x00000000,"ID: "+cmdtext[12]+ " Is Player Name: "+name+".");
return true;
}
}
pawn Код:
SendClientMessage(playerid,0x00000000,"ID: "+cmdtext[12]+ " Is Player Name: "+name+".");
Код:
error 001: expected token: "-string end-", but found "-identifier-"