Help I Need help - 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: Help I Need help (
/showthread.php?tid=611635)
Help I Need help -
Dejan12345 - 09.07.2016
When i create commands for my server in script where to put it and its work Please help
Re: Help I Need help -
Mencent - 09.07.2016
Hello!
When you create commands with "strcmp" you have to put these commands into the callback "OnPlayerCommandText".
When you use an include (like ZCMD or DCMD or something else) you have to put this command somewhere in the script (it's easiest to put this at the end of the script).
(strcmp commands:
https://sampwiki.blast.hk/wiki/Using_strcmp())
(ZCMD commands:
https://sampforum.blast.hk/showthread.php?tid=319000)
Re: Help I Need help -
Dejan12345 - 09.07.2016
I only make stuck and help command but i put it where commands need to add i dont have any error or warning
Re: Help I Need help -
Dejan12345 - 09.07.2016
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase }
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/help", cmdtext, true,5) == 0)
{
SendClientMessage(playerid, 100, "(INFO) Dobro Dosli u pomoc!");
SendClientMessage(playerid, 100, "(INFO) Nadamo se da smo vam pomogli!");
// help command
return 1;
}
if (strcmp("/stuck", cmdtext, true,5) == 0)
{
SendClientMessage(playerid, 100, "(INFO) Osvezeni ste ako budete imali jos problema kontaktirajte administraciju!");
// stuck command
return 1;
}
Re: Help I Need help -
Mencent - 09.07.2016
What's your problem now?
Re: Help I Need help -
Dejan12345 - 09.07.2016
when i enter game commands dont work i put it /help but no work it says unknow command
Re: Help I Need help -
Mencent - 09.07.2016
OK. And like this?
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/help", cmdtext, true,5) == 0)
{
SendClientMessage(playerid, 100, "(INFO) Dobro Dosli u pomoc!");
SendClientMessage(playerid, 100, "(INFO) Nadamo se da smo vam pomogli!");
// help command
return 1;
}
if (strcmp("/stuck", cmdtext, true,5) == 0)
{
SendClientMessage(playerid, 100, "(INFO) Osvezeni ste ako budete imali jos problema kontaktirajte administraciju!");
// stuck command
return 1;
}
return 0;
}
Re: Help I Need help -
Dejan12345 - 09.07.2016
yes like this