A little help (+rep).
#1

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

Код:
SendClientMessage(playerid, -1, "You planted a smokebomb!");
Replace with,

Код:
SendClientMessageEx(playerid "You planted a smokebomb!");
Reply
#3

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

Nevermind, misread.
Reply
#5

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

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

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


Forum Jump:


Users browsing this thread: 3 Guest(s)