Help in /dc ( DJ Chat) - 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: Help in /dc ( DJ Chat) (
/showthread.php?tid=598368)
Help in /dc ( DJ Chat) -
ProDude - 11.01.2016
when i go In Game and type /dc Hi it don't show me the message
PHP код:
CMD:dc(playerid, params[])
{
new Nam[MAX_PLAYERS], message[128], str[256], playername[25];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
if (!dini_Isset(AddDirFile(dir_userfiles, playername), "dj")) return SendClientMessage2(playerid, COLOR_RED, "Error: You aren't DJ.");
if(sscanf(params,"s",message)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /dc [Text]");
GetPlayerName(playerid,Nam,sizeof(Nam));
format(str,sizeof(str),"DJ Chat [%s] %s",Nam,message);
for (new a=0;a<MAX_PLAYERS;a++)
{
if (IsPlayerConnected(a))
{
if (!dini_Isset(AddDirFile(dir_userfiles, playername), "dj"))
{
SendClientMessage(a, COLOR_ORANGE, str);
}
}
}
return 1;
}
How can i fix it?
Re: Help in /dc ( DJ Chat) -
lucamsx - 11.01.2016
PHP код:
CMD:dc(playerid, params[])
{
new Nam[MAX_PLAYERS], message[128], str[256], playername[25];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
if(!dini_Isset(AddDirFile(dir_userfiles, playername), "dj")) return SendClientMessage2(playerid, COLOR_RED, "Error: You aren't DJ.");
if(sscanf(params,"s",message)) return SendClientMessage(playerid,COLOR_WHITE,"USAGE: /dc [Text]");
GetPlayerName(playerid,Nam,sizeof(Nam));
format(str,sizeof(str),"DJ Chat [%s] %s",Nam,message);
for (new a=0;a<MAX_PLAYERS;a++)
{
if (IsPlayerConnected(a))
{
if(dini_Isset(AddDirFile(dir_userfiles, playername), "dj")) //! means negation...
{
SendClientMessage(a, COLOR_ORANGE, str);
}
}
}
return 1;
}
And i would recommend you using some kind of variable like IsDJ[playerid] rather than calling dini check every time someone uses /dc.
Re: Help in /dc ( DJ Chat) -
ProDude - 11.01.2016
Thx for the code it's working and i will try to do that Thank for telling