My current commands plz Help -
nicholas1 - 28.10.2012
These are my commands.I will like for someone to help me add /cmds and /kill to my current /wfoggy and /help cmd.If I did something wrong please tell me.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/wfoggy", cmdtext, true, 5) == 0)
{
SetWeather(09);
return 1;
}
if (strcmp("/help", cmdtext, true, 5) == 0)
{ // this one
SendClientMessage(playerid, COLOR_YELLOW, "(ZR Bot)-Welcome,pelase look at our /cmds and /rules!");
return 1;
} // and this one, same as above
return 1;
}
Re: My current commands plz Help -
Eric - 28.10.2012
Not exactly sure what you're requesting. I cleaned it up a bit for you, though.
pawn Код:
if(strcmp("/wfoggy", cmdtext, true, 5) == 0) {
SetWeather(9);
return 1;
}
if(strcmp("/help", cmdtext, true, 5) == 0) {
SendClientMessage(playerid, COLOR_YELLOW, "(ZR Bot)-Welcome,pelase look at our /cmds and /rules!");
return 1;
}
Re: My current commands plz Help -
nicholas1 - 28.10.2012
Umm I got alot of errors doing what you did.Anyway,I am talking about adding the /cmds and /help too my current commands.
Re: My current commands plz Help -
Eric - 28.10.2012
Quote:
Originally Posted by nicholas1
Umm I got alot of errors doing what you did.Anyway,I am talking about adding the /cmds and /help too my current commands.
|
You probably replaced the top of it. Make sure you still have OnPlayerCommandText.
I'm still not sure what you mean; you want them added into /cmds?
Re: My current commands plz Help -
nicholas1 - 28.10.2012
its cool what im talking about I want you too add /cmds look like this
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/wfoggy", cmdtext, true, 5) == 0)
{
SetWeather(09);
return 1;
}
if (strcmp("/help", cmdtext, true, 5) == 0)
{ // this one
SendClientMessage(playerid, COLOR_YELLOW, "(ZR Bot)-Welcome,pelase look at our /cmds and /rules!");
return 1;
} // and this one, same as above
return 1;
}
if (strcmp("/cmds", cmdtext, true, 5) == 0)
{ // this one
SendClientMessage(playerid, COLOR_YELLOW, "(ZR Bot)- All of our commands so far are /help,/kill, and /cmds!");
return 1;
} // and this one, same as above
return 1;
}
Re: My current commands plz Help -
SwisherSweet - 29.10.2012
Код:
if (strcmp("/cmds", cmdtext, true, 5) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "type whatever you want here!!!");
return 1;
}
return 1;
}
Re: My current commands plz Help -
nicholas1 - 29.10.2012
I did that but got some error's can you plz add that too my other 2 commands at top?
Re: My current commands plz Help -
Eric - 29.10.2012
pawn Код:
if (strcmp("/cmds", cmdtext, true, 5) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "/wfoggy, /help");
return 1;
}
He had an extra return there. That one should work, you can change the text inside of the quotation marks to whatever you'd like.
Re: My current commands plz Help -
nicholas1 - 29.10.2012
Here are my 2 errors
C:\Documents and Settings\Owner\My Documents\GTA - San Andreas\Server\gamemodes\Z#.pwn(283) : error 010: invalid function or declaration
C:\Documents and Settings\Owner\My Documents\GTA - San Andreas\Server\gamemodes\Z#.pwn(286) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
This what I did below
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/wfoggy", cmdtext, true, 5) == 0)
{
SetWeather(09);
return 1;
}
if (strcmp("/help", cmdtext, true, 5) == 0)
{ // this one
SendClientMessage(playerid, COLOR_YELLOW, "(ZR Bot)-Welcome,pelase look at our /cmds and /rules!");
return 1;
} // and this one, same as above
return 1;
}
if (strcmp("/cmds", cmdtext, true, 5) == 0) - this 283#
{
SendClientMessage(playerid, COLOR_YELLOW, "/wfoggy, /help");
return 1; - this is 286
}
Re: My current commands plz Help -
tyler12 - 29.10.2012
return 0; at the end.