Just tell what is wrong here' - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Just tell what is wrong here' (
/showthread.php?tid=198926)
Just tell what is wrong here' -
blackwave - 13.12.2010
It's a command, which detects player team and send the message for all players which are of his team
pawn Код:
dcmd_x(playerid,params[])
{
new text[64];
new name[30];
new string[128];
GetPlayerName(playerid, name, 30);
if(sscanf(params,"s[64]",text)) SendClientMessage(playerid, cinza, "/x <texto>");
if(GetPlayerTeam(playerid) == 0) SendClientMessage(playerid, cinza, "Vocк nгo tem grupo ainda");
format(string,sizeof(string),"CHAT: %s [ID: %d]: %s",name,playerid,params[2]);
foreach (Player, i)
{
if(GetPlayerTeam(playerid) == GetPlayerTeam(i))
{
SendClientMessage(i,agua,string);
}
}
return 1;
}
It just returns nothing o.o
Re: Just tell what is wrong here' -
Vince - 13.12.2010
pawn Код:
if(sscanf(params,"s[64]",text)) SendClientMessage(playerid, cinza, "/x <texto>");
Is not necessary, as you have only one param to pass.
Remove the sscanf line, and replace your format function with this one:
pawn Код:
format(string, sizeof(string), "CHAT: %s [ID: %d]: %s", name, playerid, params);
Then it should work.
Re: Just tell what is wrong here' -
blackwave - 13.12.2010
Quote:
Originally Posted by Vince
pawn Код:
if(sscanf(params,"s[64]",text)) SendClientMessage(playerid, cinza, "/x <texto>");
Is not necessary, as you have only one param to pass.
Remove the sscanf line, and replace your format function with this one:
pawn Код:
format(string, sizeof(string), "CHAT: %s [ID: %d]: %s", name, playerid, params);
Then it should work.
|
At all worked. Thx. But I think problem was on foreach, cuz I replaced for the normal:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)