SA-MP Forums Archive
Wrong Commands - 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: Wrong Commands (/showthread.php?tid=549189)



Wrong Commands - nezo2001 - 05.12.2014

Hello i have downloaded a gamemode but when i write any wrong command it do nothing so i want something like :-
if the player write a wrong command like :
/ghwkjf
Server Send :
Wrong command blablabla
How can i do it


Re: Wrong Commands - JaKe Elite - 05.12.2014

What command processor are you using?


Re: Wrong Commands - nezo2001 - 05.12.2014

Quote:
Originally Posted by _Jake_
Посмотреть сообщение
What command processor are you using?
Sorry i am beginner what do you mean


Re: Wrong Commands - Bingo - 05.12.2014

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
Sorry i am beginner what do you mean
Show us one of your command. (Any)


Re: Wrong Commands - OsteeN - 05.12.2014

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
Sorry i am beginner what do you mean
He's asking if you're using YCMD, ZCMD, OnPlayerCommand etcetera.


Re: Wrong Commands - Kaperstone - 05.12.2014

Quote:
Originally Posted by Bingo
Посмотреть сообщение
Show us one of your command. (Any)
Quote:
Originally Posted by OsteeN
Посмотреть сообщение
He's asking if you're using YCMD, ZCMD, OnPlayerCommand etcetera.
Lemme, expend your words.

Open your game mode file which is located in "gamemodes" folder and then look at the first few lines where written "#include" and look for "zcmd" or "y_commands" if both do not present then click CTRL + F and type dcmd, if neither exist, then go to the callback named "OnPlayerCommandText" and look for strcmp, if it present then you're processing commands using strcmp.


Re: Wrong Commands - nezo2001 - 05.12.2014

i am using zcmd

and here is one from commands
PHP код:
command(meplayeridparams[]) {
    new
        
string[128]; // Updated this as I forgot about the whole params usage at the time of originally creating this.... but seeing as how noobs constantly rip this command I might as well give them some good code to rip from! (yes I'm talking about you, RealCop228 and all the others)
    
if(isnull(params)) {
        return 
SendClientMessage(playeridWHITE"SYNTAX: /me [action]");
    }
    else {
        if(
Player[playerid][PrisonID] == 1) {
            
SendClientMessage(playeridWHITE"You're unable to do this right now!");
        }
        else {
            
format(stringsizeof(string), "* %s %s"GetName(playerid), params);
            
NearByMessage(playeridNICESKYstring);
            
            
Player[playerid][MeActions]++;
            switch(
Player[playerid][MeActions]) {
                case 
100: {
                    
SendClientMessage(playeridWHITE"You have unlocked a new achievement!");
                    
SendClientMessage(playeridGREY"You have executed 100 /me actions.");
                    
Player[playerid][AchievementRank]++;
                }
                case 
200: {
                    
SendClientMessage(playeridWHITE"You have unlocked a new achievement!");
                    
SendClientMessage(playeridGREY"You have executed 200 /me actions.");
                    
Player[playerid][AchievementRank]++;
                }
            }
        }
    }
    return 
1;