/say command help
#1

I have this command And I want to convert it to ZCMD

Can any one help me


Код HTML:
		if(strcmp(cmd, "/say", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if (PlayerInfo[playerid][pAdmin] >= 3)
			{
			   GetPlayerName(playerid, sendername, sizeof(sendername));
			   new length = strlen(cmdtext);
			   while ((idx < length) && (cmdtext[idx] <= ' '))
			   {
				   idx++;
			   }
			   new offset = idx;
			   new result[800];
			   while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			   {
				   result[idx - offset] = cmdtext[idx];
				   idx++;
			   }
			   result[idx - offset] = EOS;
			   if(!strlen(result))
			   {
				   SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/say [message]");
				   return 1;
			   }
			   format(string, sizeof(string), "Admin: %s",result);
			   OOCNews(0x3399FFAA,string);
			}
			else
			{
			   SendClientMessage(playerid, COLOR_WHITE,"You cant use this command");
			   return 1;
			}
		}
		return 1;
	}
Reply
#2

Pleae answer me sir...
I want some help

I will thank every one will help me
Reply
#3

pawn Код:
CMD:say(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] >= 3)
            {
               GetPlayerName(playerid, sendername, sizeof(sendername));
               new length = strlen(cmdtext);
               while ((idx < length) && (cmdtext[idx] <= ' '))
               {
                   idx++;
               }
               new offset = idx;
               new result[800];
               while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
               {
                   result[idx - offset] = cmdtext[idx];
                   idx++;
               }
               result[idx - offset] = EOS;
               if(!strlen(result))
               {
                   SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/say [message]");
                   return 1;
               }
               format(string, sizeof(string), "Admin: %s",result);
               OOCNews(0x3399FFAA,string);
            }
            else
            {
               SendClientMessage(playerid, COLOR_WHITE,"You cant use this command");
               return 1;
            }
        }
        return 1;
    }
You can use params as your message.

You can do like:

if(!isnull(params))
{
format(string, sizeof(string), "Admin: %s", params)
OOCNews(0x3399FFAA,string);
}

I think it's a function from SSCANF
Reply
#4

Thx man

Good job

you helped me so much

and thank you again
Reply
#5

Here's it.
PHP код:
CMD:say(playerid,params[])
{
  if(
PlayerInfo[playerid][pAdmin] >=3)) return SendClientMessage(playerid0xFF0000FF"You can't use this command.");
  if(
isnull(params)) return SendClientMessage(playerid0xFF0000"Usage: /say (text)");
  new 
lstr[128];
  
format(lstr,sizeof(lstr),"Admin:%s"params)
  
OOCNews(0x3399FFAA,lstr);
  return 
1;

Edit:Late.
Reply
#6

try this
Код:
CMD:say(playerid,params[])
{
	if(IsPlayerConnected(playerid))
	{
	   	if (PlayerInfo[playerid][pAdmin] >= 3)
		{
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[800];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/say [message]");
				return 1;
			}
			   format(string, sizeof(string), "Admin: %s",result);
			   OOCNews(0x3399FFAA,string);
			}
			else
			{
			   SendClientMessage(playerid, COLOR_WHITE,"You cant use this command");
			   return 1;
			}
		}
	}
	return 1;
}
Reply
#7

and thank you Lordz it's helpful

that's great guys
Reply
#8

and thank you Lordz it's helpful

that's great guys
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)