SA-MP Forums Archive
A little help (+rep). - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: A little help (+rep). (/showthread.php?tid=363118)



A little help (+rep). - [Twixx] - 26.07.2012

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;
}



Re: A little help (+rep). - Akira297 - 26.07.2012

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

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



Re: A little help (+rep). - [Twixx] - 26.07.2012

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?


Re: A little help (+rep). - Stigg - 26.07.2012

Nevermind, misread.


Re: A little help (+rep). - Jarnu - 26.07.2012

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


Re: A little help (+rep). - Roko_foko - 26.07.2012

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.


Re: A little help (+rep). - [Twixx] - 26.07.2012

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.