Fakechat - 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: Fakechat (
/showthread.php?tid=306035)
Fakechat -
spd_sahil - 24.12.2011
Not working... :/
error on console : [02:36:29] sscanf warning: Strings without a length are deprecated, please add a destination size.
pawn Код:
dcmd_fakechat(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new id,text[128];
if(sscanf(params, "us", id, text)) return SendClientMessage(playerid,0xFF7800FF, "Usage: /fakechat [ID] [TEXT]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF7800FF, "player offline");
SendPlayerMessageToAll(id,text);
return 1;
}
return 0;
}
Re: Fakechat -
Calgon - 24.12.2011
pawn Код:
dcmd_fakechat(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new id,text[128];
if(sscanf(params, "us[127]", id, text)) return SendClientMessage(playerid,0xFF7800FF, "Usage: /fakechat [ID] [TEXT]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF7800FF, "player offline");
SendPlayerMessageToAll(id,text);
return 1;
}
return 0;
}
You needed to specify the size of the string for sscanf.
Re: Fakechat -
spd_sahil - 24.12.2011
okay the console error aint coming.. but when i try to fakechat for myself.. it says player offline..
Re: Fakechat -
coole210 - 24.12.2011
Why not use OnPlayerText(id,text);
Re: Fakechat -
spd_sahil - 24.12.2011
how would i do that ? /fakechat is a command
Re: Fakechat -
Reix[EST] - 24.12.2011
Thanks for working command Calgon, +1 rep
Re: Fakechat -
spd_sahil - 25.12.2011
It aint working but... it doenst fake chat myself.. i havent tested with other people.. but theres no reason why it wouldnt fakechat me
Re: Fakechat -
wildcookie007 - 25.12.2011
have u even tried to login to rcon?
Re: Fakechat -
spd_sahil - 25.12.2011
Quote:
Originally Posted by wildcookie007
have u even tried to login to rcon?
|
-.- -.- OBVIOUSLY
Re: Fakechat - suhrab_mujeeb - 25.12.2011
pawn Код:
dcmd_fakechat(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new id,text[128], str[128] , NameOfPlayer[24];
new color = GetPlayerColor ( playerid );
if(sscanf(params, "us[127]", id, text)) return SendClientMessage(playerid,0xFF7800FF, "Usage: /fakechat [ID] [TEXT]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF7800FF, "player offline");
GetPlayerName ( id , NameOfPlayer , 24 );
format ( str , 128 , "%s: {FFFFFF}%s" , NameOfPlayer , text );
SendClientMessageToAll ( color , str );
return 1;
}
return 0;
}