/say command help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /say command help (
/showthread.php?tid=385133)
/say command help -
aboa - 14.10.2012
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;
}
Re: /say command help -
aboa - 14.10.2012
Pleae answer me sir...
I want some help
I will thank every one will help me
Re : /say command help -
lelemaster - 14.10.2012
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
Re: /say command help -
aboa - 14.10.2012
Thx man
Good job
you helped me so much
and thank you again
Re: /say command help -
Lordzy - 14.10.2012
Here's it.
PHP код:
CMD:say(playerid,params[])
{
if(PlayerInfo[playerid][pAdmin] >=3)) return SendClientMessage(playerid, 0xFF0000FF, "You can't use this command.");
if(isnull(params)) return SendClientMessage(playerid, 0xFF0000, "Usage: /say (text)");
new lstr[128];
format(lstr,sizeof(lstr),"Admin:%s", params)
OOCNews(0x3399FFAA,lstr);
return 1;
}
Edit:Late.
Re: /say command help -
Windrush - 14.10.2012
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;
}
Re: /say command help -
aboa - 14.10.2012
and thank you Lordz it's helpful
that's great guys
Re: /say command help -
aboa - 14.10.2012
and thank you Lordz it's helpful
that's great guys