SA-MP Forums Archive
/ask and /ans - 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: /ask and /ans (/showthread.php?tid=462772)



/ask and /ans - Thundey - 08.09.2013

hey there ,

i did my /ask and /ans system , /ask is for players to ask any question and /ans is for admins to answer the players questions , but i am kinda confused because when i do /ask no message appears for the admins so if anyone can show me a fine script for these both with dcmd so i can compare what errors i have done and this will help me for more commands in the future.


Re: /ask and /ans - knackworst - 08.09.2013

What admin script are you using?


Re: /ask and /ans - Thundey - 08.09.2013

i'm using dcmd , i purely made them.


Re: /ask and /ans - knackworst - 08.09.2013

I would say something like this then:
but I recommend you to use sscanf by ****** (https://sampforum.blast.hk/showthread.php?tid=120356)

pawn Код:
dcmd_ask(blabla...
{
new question[128], string[256], PlayerName[MAX_PLAYER_NAME];
if (sscanf(params, "s[128]", question)) return SendClientMessage(playerid, 0xFF0000AA, "Use: /ask <question> ");
GetPlayerName(playerid, PlayerName, sizeof PlayerName);
format(string, sizeof string, "[QUESTION]\"%s(%i)\": %s", PlayerName, playerid, question);
for(new i; i<MAX_PLAYERS; i++)
{
       if(IsPlayerAdmin(i)) //Change this to what you use to mark an admin in your code
       {
               SendClientMessage(i, 0x00FF00, string);
       }
}
return 1;
}
Something like this?
NOTE: only works if you have sscanf


Re: /ask and /ans - Thundey - 08.09.2013

Thanks buddy , +REP