#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
Reply
#2

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 Код:
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;
}
Sorry for bad indention if that happened.
Reply
#3

Quote:
Originally Posted by Micko123
Посмотреть сообщение
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
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;
}
Reply
#4

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
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 Код:
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;
}


Sorry for bad indention if that happened.
I've tried to make it on my own, and when i failed i came here. And thanks
Reply
#5

Quote:
Originally Posted by KevinExec
Посмотреть сообщение
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;
}
Yes it is supposed to ask admins about help when having a problem. Thank you for helping me I've been strugling with this for long time
PS: Sorry for bad english
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)