[HELP] A little help with the string
#1

Hello. I have a little problem with a command i am trying to make "/do". So far i did this:
Код:
	if(!strcmp(cmdtext,"/do ", true, 3))
    {
        if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /do [action]");
  		new string[128];
  		GetPlayerName(playerid, string, sizeof(string));
  		format(string,sizeof(string),"** %s (( %s ))", string, cmdtext[4]);
		ProxDetector(170.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
  		return 1;
	}
But i want to reverse the 2 "%s"'s so instead of being "** Name ((Text))" I want it to be: "** Text ((Name))"
Can anyone tell me please how i can do that?
Reply
#2

pawn Код:
if(!strcmp(cmdtext,"/do ", true, 3))
    {
        if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /do [action]");
        new string[128];
        GetPlayerName(playerid, string, sizeof(string));
        format(string,sizeof(string),"** %s (( %s ))", cmdtext[4], string);
        ProxDetector(170.0, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
        return 1;
    }
You mean like this?
Reply
#3

YES Thank you!
Reply
#4

No problem! It's completely safe to change them with places.
Reply
#5

But can you please explain why you changed Cmdtext with string?
Cmdtext was the text and string the name?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)