Posts: 625
Threads: 38
Joined: Nov 2011
Hey guys, I just tried to make a simple smokebomb filterscript, but for some reason when I do the cmd ingame, the text dosen't get displayed and the object does not appear, check out the code and please tell me the problem:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/smokebomb", cmdtext, true, 10) == 0)
{
SendClientMessage(playerid, -1, "You planted a smokebomb!");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateObject(18716, x, y, z, 0, 0, 0, 250.0);
return 1;
}
return 0;
}
Posts: 1,274
Threads: 54
Joined: Jul 2012
Код:
SendClientMessage(playerid, -1, "You planted a smokebomb!");
Replace with,
Код:
SendClientMessageEx(playerid "You planted a smokebomb!");
Posts: 625
Threads: 38
Joined: Nov 2011
Quote:
Originally Posted by Akira297
Код:
SendClientMessage(playerid, -1, "You planted a smokebomb!");
Replace with,
Код:
SendClientMessageEx(playerid "You planted a smokebomb!");
|
Didn't help! When I tried to compile it gave me this error:
\filterscripts\smokebomb.pwn(93) : error 035: argument type mismatch (argument 2)
And when I tried it IG, nothing changed. Anyone else?
Posts: 541
Threads: 60
Joined: Jul 2009
Reputation:
0
This code looks fine for me.
You sure that the problem is in that part of code?
I think the problem is before, in code above the code you have pasted here.
Posts: 625
Threads: 38
Joined: Nov 2011
Quote:
Originally Posted by Jarnu
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/smokebomb", true)) { SendClientMessage(playerid, 0xFFFFFFFF, "You planted a smokebomb!"); new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); CreateObject(18716, x, y, z, 0, 0, 0, 250.0); return 1; } return 0; }
Hope it will help
|
Worked! Thank you very much! + rep'd.