/cnnnn Problem.
#1

Hi guys,
First I show my CMD :
pawn Код:
if(strcmp(cmd, "/cnnnn", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] >= 3)
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "Dastoor: /cnnnn <text> ");
                return 1;
            }
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[128];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            format(string, sizeof(string), "%s",result);
            foreach (Player, i)
            {
                if(IsPlayerConnected(i) == 1)
                {
                    displayCenterHUDInfo(i, string, 5);
                }
            }
            return 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD1, "   Shoma dastresie kafi baraye anjame inkar ra nadarid !");
            return 1;
        }
    }
The problem is here that, When I type "/cnnnn Hi Guys" for example, It only shows "Guys" word.
I want to get "Hi Guys" not only "Guys".
Also , displayCenterHUDInfo is like SendClientMessage ...
+Rep for the best answer.
Reply
#2

Explain more for displayCenterHUDInfo, please.
Reply
#3

It's just a function like SendClientMessage that shows a text
Reply
#4

displayCenterHUDInfo(i, string, 5); - what it means the last parameter?(5)
Reply
#5

Why do u use old school methods?

:-/
Reply
#6

@[ND]xXZeusXx Iwonder why, too. Use ZCMDand Sscanf
Reply
#7

Please, use a processor commands (zcmd, mcmd or an another) and sscanf...
Reply
#8

If I could, make sure I would do that
If you can , please share it!
Reply
#9

Try this.
Код:
CMD:cnnnn(playerid, params[]) {
	new Text[129];
	if(!PLayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid, -1, "Shoma dastresie kafi baraye anjame inkar ra nadarid !");
	if(sscanf(params, "s[128]", Text)) return SendClientMessage(playerid, -1, "Dastoor: /cnnnn <text> ");
	foreach(Player, x) {
		if(IsPlayerConnected(x)) {
			SendClientMessage(x, -1, Text); //IDK I think your mistake is in 'displayCenterHUDInfo' where the last param is 5.
		}
	}
	return 1;
}
There are the links:
ZCMD by ZeeX.
SSCANF by ******.
Reply
#10

Quote:
Originally Posted by bgedition
Посмотреть сообщение
Try this.
Код:
CMD:cnnnn(playerid, params[]) {
	new Text[129];
	if(!PLayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid, -1, "Shoma dastresie kafi baraye anjame inkar ra nadarid !");
	if(sscanf(params, "s[128]", Text)) return SendClientMessage(playerid, -1, "Dastoor: /cnnnn <text> ");
	foreach(Player, x) {
		if(IsPlayerConnected(x)) {
			SendClientMessage(x, -1, Text); //IDK I think your mistake is in 'displayCenterHUDInfo' where the last param is 5.
		}
	}
	return 1;
}
There are the links:
ZCMD by ZeeX.
SSCANF by ******.
Last parameter is about Time. (How many seconds that message should stay on players screens)
Anyway , I'm going to try this ...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)