SA-MP Forums Archive
ZCMD - 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: ZCMD (/showthread.php?tid=605721)



ZCMD - Micko123 - 23.04.2016

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


Re: ZCMD - DarkLored - 23.04.2016

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.


Re: ZCMD - iKevin - 23.04.2016

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;
}



Re: ZCMD - Micko123 - 23.04.2016

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


Re: ZCMD - Micko123 - 23.04.2016

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