Command Help.
#1

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:

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;
        }
    }
But i cant figure out how to make it so it shows the Response, i have
pawn Код:
SendClientMessage(playerid,0x00000000,"ID: "+cmdtext[12]+ " Is Player Name: "+name+".");
As the response but i get an error saying:

Код:
error 001: expected token: "-string end-", but found "-identifier-"
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?
Reply


Messages In This Thread
Command Help. - by CSMajor - 28.07.2010, 15:59
Re: Command Help. - by Kar - 28.07.2010, 16:02
Re: Command Help. - by Vince - 28.07.2010, 16:04
Re: Command Help. - by Conroy - 28.07.2010, 16:06
Re: Command Help. - by iggy1 - 28.07.2010, 16:24
Re: Command Help. - by CSMajor - 28.07.2010, 16:47
Re: Command Help. - by iggy1 - 28.07.2010, 16:53
Re: Command Help. - by CSMajor - 28.07.2010, 17:04

Forum Jump:


Users browsing this thread: 2 Guest(s)