[Help] How to do a /helpme command -
PilotXtreme - 24.10.2010
I'm a big newbie.
Could someone show me how to do a /helpme command?
Re: [Help] How to do a /helpme command -
Camacorn - 24.10.2010
If using ZCMD:
command(helpme, playerid, params[])
{
#pragma unused params
SendClientMessage(playerid, color,"texthere...");
SendClientMessage(playerid, color,"texthere...");
SendClientMessage(playerid, color,"texthere...");
SendClientMessage(playerid, color,"texthere...");
return 1;
}
Re: [Help] How to do a /helpme command -
Camacorn - 24.10.2010
If using STRCMP:
if(strcmp(cmdtext,"/helpme",true)==0)
{
SendClientMessage(playerid, color,"texthere...");
SendClientMessage(playerid, color,"texthere...");
SendClientMessage(playerid, color,"texthere...");
SendClientMessage(playerid, color,"texthere...");
return 1;
}
Re: [Help] How to do a /helpme command -
PilotXtreme - 24.10.2010
How does that exactly work?
EDIT: I want it so you do /helpme then your reason so admins can see it
Re: [Help] How to do a /helpme command -
Camacorn - 24.10.2010
You put it under
public OnPlayerCommandText(playerid, cmdtext[])
like this:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/helpme",true)==0)
{
SendClientMessage(playerid, color,"texthere...");
SendClientMessage(playerid, color,"texthere...");
SendClientMessage(playerid, color,"texthere...");
SendClientMessage(playerid, color,"texthere...");
return 1;
}
return 0;
}
Then go ingame and type /helpme
Note: change the 'texthere...' to the info you want to show the member.
Re: [Help] How to do a /helpme command -
dLu - 24.10.2010
EDIT: Camacorn was faster, sorry. Delete this
Place the text that Camacorn wrote under
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/helpme", cmdtext, true))
{
SendClientMessage(playerid, YOUR_COLOR, "[COMMANDS]: Your text bla bla");
SendClientMessage(playerid, YOUR_COLOR, "[SOMETHING]: Your text bla bla");
}
return 1;
}
That's the old classic way, if you use ZCMD use what Camacorn wrote you.
EDIT: Camacorn was faster, sorry. Delete this
Re: [Help] How to do a /helpme command -
Steven82 - 24.10.2010
Quote:
Originally Posted by PilotXtreme
How does that exactly work?
EDIT: I want it so you do /helpme then your reason so admins can see it
|
Please explain more next time -_-
Re: [Help] How to do a /helpme command -
PilotXtreme - 24.10.2010
You do /helpme [reason you need help] then that gets sent to the admins like a report
Re: [Help] How to do a /helpme command -
Jochemd - 25.10.2010
Untested but must work, just made in a minute.
pawn Код:
if(strcmp(cmdtext,"/helpme",true) == 0)
{
new reason[128];
if(sscanf(params,"s",reason)) return SendClientMessage(playerid,COLOR_RED,"* Syntax Error: /helpme [reason]");
else
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(i))
{
new Playername[MAX_PLAYER_NAME],string[128];
GetPlayerName(playerid,Playername,sizeof(Playername));
format(string,sizeof(string),"%s has requested help with the following reason: %s",Playername,reason);
SendClientMessage(i,0x55FF00FF,string); // Green
}
}
}
}
return 1;
}
If you need the sscanf stock, if you don't have it already, you can find it
here. Just place it anywhere in your code