23.10.2016, 18:44
(
Последний раз редактировалось jlalt; 23.10.2016 в 19:23.
)
Quote:
i need a command for players to use to send a message to rcon admins, such as: (/helpme i forgot my pass)
Thank you |
PHP код:
#include a_samp
#include zcmd
new LastTimeUsedHelpMe[MAX_PLAYERS];
CMD:helpme(playerid, params[])
{
if(isnull(params))
{
SendClientMessage(playerid, -1,"Usage: /helpme [question]");
}
else
{
new i = 0, playernamezz[24], string[128];
if((LastTimeUsedHelpMe[playerid]-gettime()) < 5) // use it once every 5 seconds
{
format(string, sizeof string,"ERROR: You need to wait %d seconds before using this command again!",((LastTimeUsedHelpMe[playerid]+5)-gettime()));
SendClientMessage(playerid, -1, string);
}
else
{
GetPlayerName(playerid, playernamezz, sizeof playernamezz);
LastTimeUsedHelpMe[playerid] = gettime();
format(string, sizeof string,"[Question]: %s(%d) |- Question: %s -|",playernamezz, playerid, params);
do
{
if(!IsPlayerConnected(i) || !IsPlayerAdmin(i))
{
i++;
continue;
}
else
{
SendClientMessage(i, -1, string);
i++;
}
}
while(i < MAX_PLAYERS);
}
}
return 1;
}