Help I Need help
#1

When i create commands for my server in script where to put it and its work Please help
Reply
#2

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)
Reply
#3

I only make stuck and help command but i put it where commands need to add i dont have any error or warning
Reply
#4

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;
}
Reply
#5

What's your problem now?
Reply
#6

when i enter game commands dont work i put it /help but no work it says unknow command
Reply
#7

OK. And like this?
PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/help"cmdtexttrue,5) == 0)
    {
        
SendClientMessage(playerid100"(INFO) Dobro Dosli u pomoc!");
        
SendClientMessage(playerid100"(INFO) Nadamo se da smo vam pomogli!");
        
// help command
        
return 1;
    }
    if (
strcmp("/stuck"cmdtexttrue,5) == 0)
    {
        
SendClientMessage(playerid100"(INFO) Osvezeni ste ako budete imali jos problema kontaktirajte administraciju!");
        
// stuck command
        
return 1;
    }
    return 
0;

Reply
#8

yes like this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)