Adds Command: to string - 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: Adds Command: to string (
/showthread.php?tid=384608)
Adds Command: to string -
Swimor - 12.10.2012
Hello,
I'm trying to do something like this:
Код:
format(str, sizeof(str), "/test %d", playerid);
OnPlayerCommandText(playerid, str);
And I gets in the string Command: /Test 0 not found...
This adds the Command auto..
I try to do like this:
Код:
printf("%s", str);
format(str, sizeof(str), "/test %d", playerid);
printf("%s", str);
OnPlayerCommandText(playerid, str);
End first return's hello.
the second Command: /test 0
WHat to do?
Re: Adds Command: to string -
Camacorn - 12.10.2012
Are you using zcmd?
If so, just use cmd_cmdnamehere(playerid,params);
Re: Adds Command: to string -
Swimor - 12.10.2012
No, I'm not using any command prc...
AW: Adds Command: to string -
Nero_3D - 12.10.2012
I didnt understood what you actually want
You pass "/test 0" to OnPlayerCommandText
And than you get Command not found, so there isnt a /test command
Re: Adds Command: to string -
Swimor - 15.10.2012
noooooo,
ehrn i'm formating the command this adds Command: bofore the slash(/)...
Re: Adds Command: to string -
T-Raw - 15.10.2012
Код:
public OnPlayerText(playerid, text[])
{
if(strfind(text, "write w/e u want here", true) != -1 && strfind(text, "get car", true) != -1)
{
// our code goes here = whatever u want to happen
}
return 1;
}
REP ++ if i helped u :d