My current commands plz Help
#1

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

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;
}
Reply
#3

Umm I got alot of errors doing what you did.Anyway,I am talking about adding the /cmds and /help too my current commands.
Reply
#4

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?
Reply
#5

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;
}
Reply
#6

Код:
if (strcmp("/cmds", cmdtext, true, 5) == 0)
{
SendClientMessage(playerid, COLOR_YELLOW, "type whatever you want here!!!");
return 1;
}
return 1;
}
Reply
#7

I did that but got some error's can you plz add that too my other 2 commands at top?
Reply
#8

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.
Reply
#9

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
}
Reply
#10

return 0; at the end.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)