23.04.2016, 18:11
Hey guys. I am making my gamemode from scratch. I did some commands so far but i need help with /askq or /askq command. Is there any way that someone can help me with it. I want to do it with Zcmd. Thank you
![Smiley](images/smilies/smile.png)
CMD:askq(playerid, params[])
{
new string[90];
if(sscanf(params, "s", string))
{
//code here
}
//code here for what it does after it was executed correctly
return 1;
}
Hey guys. I am making my gamemode from scratch. I did some commands so far but i need help with /askq or /askq command. Is there any way that someone can help me with it. I want to do it with Zcmd. Thank you
![]() |
#define COLOR_LIGHTYELLOW 0xFFFF91FF #define COLOR_YELLOW 0xFFFF00AA #include <sscanf> #include <foreach> new name[MAX_PLAYER_NAME]; stock SendAdminMessage(color, string2[]) { foreach(Player, i) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdmin] >= 1) // You can use your own player variables here. { SendClientMessage(i, color, string2); } } } return 1; } stock PlayerName(playerid) { GetPlayerName(playerid, name, sizeof(name)); return name; } CMD:askq(playerid, params[]) { new text[128], str[200]; if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0xFFFFFFFF, "{00BFFF}[SYNTAX]:{FFFFFF}/askq [text]"); { format(str, sizeof(str), "Question from [ID: %d] %s: %s", playerid, name, text); SendAdminMessage(COLOR_LIGHTYELLOW, str); SendClientMessage(playerid, COLOR_YELLOW, "Your question was sent to online administrators, thank you."); } return 1; }
Try to do it first before you ask for code, this is not a scripting request section it is a 'scripting help' but I'll give you a head start.
pawn Код:
Sorry for bad indention if that happened. |
What is it supposed to do? Ask admins/helpers for something?
Код:
#define COLOR_LIGHTYELLOW 0xFFFF91FF #define COLOR_YELLOW 0xFFFF00AA #include <sscanf> #include <foreach> new name[MAX_PLAYER_NAME]; stock SendAdminMessage(color, string2[]) { foreach(Player, i) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdmin] >= 1) // You can use your own player variables here. { SendClientMessage(i, color, string2); } } } return 1; } stock PlayerName(playerid) { GetPlayerName(playerid, name, sizeof(name)); return name; } CMD:askq(playerid, params[]) { new text[128], str[200]; if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0xFFFFFFFF, "{00BFFF}[SYNTAX]:{FFFFFF}/askq [text]"); { format(str, sizeof(str), "Question from [ID: %d] %s: %s", playerid, name, text); SendAdminMessage(COLOR_LIGHTYELLOW, str); SendClientMessage(playerid, COLOR_YELLOW, "Your question was sent to online administrators, thank you."); } return 1; } |