2 Questions
#1

Hello everybody. I have 2 quick questions.

1° Is possible to force a command to a player?
2° Is possible to play more sounds at once per player? (Streaming one)
Reply
#2

1 - yes

2 - some sounds are compatible with others but I don't think all
Reply
#3

1)

If you're using ZCMD, then you could simply do

pawn Код:
cmd_commandname(playerid, "");
unless the command has parameters in which case you would have to fill out the "" with the parameters.

As for strcmp, I'm not entirely sure but I guess you could do this

pawn Код:
CallLocalFunction("OnPlayerCommandText", "ds", playerid, "");
and just like I said for ZCMD, replace the "" with parameters.


2)

I don't believe so.
Reply
#4

@SuperViper i don't need a command processor. I just need to FORCE a command to a player

E.g FoceCommandPlayer(0, "/help"); on that case the ID 0 will execute the command automaticaly.
Reply
#5

If you actually read my post, you would see that I explained how to do it for both ZCMD and strcmp. Here's a function/macro though to force a command for a player.


strcmp:

pawn Код:
#define ForcePlayerCommand(%0, %1) CallRemoteFunction("OnPlayerCommandText", "ds", %0, %1)
ForcePlayerCommand(playerid, cmdtext[])


ZCMD:

pawn Код:
ForcePlayerCommand(playerid, cmd[], params[] = "")
{
    new functionName[32];
    format(functionName, sizeof(functionName), "cmd_%s", cmd);
    CallRemoteFunction(functionName, "ds", playerid, params);
}
ForcePlayerCommand(playerid, cmd[], params[] = "")

params is optional
Reply
#6

@SuperViper Tested & Worked. I've never think about CallRemoteFunction XD.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)