Where do I place the cmd to work?
#1

Hi guys i need know the correct place to put the cmd (in the pawn file of GM) for it to work but i don't know exactly where to place it exactly.Can anyone help?I'm just a new scripter. The code is:


if(!strcmp("/thecmd", cmdtext, true))
{
SetPlayerPos(playerid, -1992.3206787109, 2260.1875, 18.924165725707);
SetPlayerFacingAngle(playerid, 0);
SendClientMessage(playerid, 0xFED530FF, The line i need to put(i know about it).);
return 1;
}

If anyone can help please do help thank you.
Reply
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/thecmd", cmdtext, true))
    {
        SetPlayerPos(playerid, -1992.3206787109, 2260.1875, 18.9241657257);
        SetPlayerFacingAngle(playerid, 0);
        SendClientMessage(playerid, 0xFED530FF," The line i need to put(i know about it).");
        return 1;
    }
    //More commands here
    return 0;
}
Reply
#3

I don't understand. What i need is the exact line to place this.
Reply
#4

Between
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
and
pawn Код:
return 0;
}
Reply
#5

Somewhere in your gamemode,not under any other callbacks.
Reply
#6

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
Somewhere in your gamemode,not under any other callbacks.
The callback where the commands should be inside, yes.
Don't misdirect.

<This forum requires that you wait 120 seconds between posts. Please try again in 70 seconds.> - stfu
Reply
#7

Quote:
Originally Posted by LarzI
Посмотреть сообщение
The callback where the commands should be inside, yes.
Don't misdirect.

<This forum requires that you wait 120 seconds between posts. Please try again in 70 seconds.> - stfu
I believe he meant the OnPlayerCommandText callback I gave him.
Reply
#8

Ah, my bad then.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)