SendPlayerCommand - 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: SendPlayerCommand (
/showthread.php?tid=570628)
SendPlayerCommand -
ak1nator - 12.04.2015
Hello!
I need a function like SendRCONCommands but for normal commands.
I've tried to do this:
Код:
#define SendPlayerCommand(%0,%1) CallLocalFunction("OnPlayerCommandText", "ds", %0, %1);
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/command", cmdtext))
{
SendPlayerCommand(playerid,"/vehicles");
return 1;
}
return 0;
}
but i have this error:
Код:
C:\ParadiseCityServer\likers.pwn(1039) : error 036: empty statement
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
AW: SendPlayerCommand -
Mencent - 12.04.2015
Hello!
PHP код:
#define SendPlayerCommand(%0,%1); CallLocalFunction("OnPlayerCommandText", "ds", %0, %1);
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/command", cmdtext))
{
SendPlayerCommand(playerid,"/vehicles");
return 1;
}
return 0;
}
EDIT:
@******: I removed the other code
Mencent
Re: SendPlayerCommand -
Ahmad45123 - 12.04.2015
Try this:
pawn Код:
#define SendPlayerCommand(%0,%1) CallLocalFunction("OnPlayerCommandText", "ds", %0, %1)
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/command", cmdtext))
{
SendPlayerCommand(playerid,"/vehicles");
return 1;
}
return 0;
}
AW: SendPlayerCommand -
Mencent - 12.04.2015
@Ahmad45123:
That will not work, because you have to put in #define the semicolon and do not remove)
Look at you my code above.
Mencent
Re: SendPlayerCommand -
ATGOggy - 12.04.2015
Why not make it a stock?
PHP код:
stock SendPlayerCommand(playerid, cmdtext[]) CallLocalFunction("OnPlayerCommandText", "is", playerid, cmdtext);
Re: AW: SendPlayerCommand -
Konstantinos - 12.04.2015
Quote:
Originally Posted by Mencent
@Ahmad45123:
That will not work, because you have to put in #define the semicolon and do not remove)
Look at you my code above.
Mencent
|
It doesn't matter at all.
Quote:
Originally Posted by ATGOggy
Why not make it a stock?
PHP код:
stock SendPlayerCommand(playerid, cmdtext[]) CallLocalFunction(playerid, cmdtext);
|
"stock" is not function.. :
https://sampforum.blast.hk/showthread.php?tid=570635
Also wrong number of arguments:
https://sampwiki.blast.hk/wiki/CallLocalFunction
Re: SendPlayerCommand -
ak1nator - 13.04.2015
Thanks guys!