SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/09/2018, 04:02 PM   #1
v1k1nG
Huge Clucker
 
v1k1nG's Avatar
 
Join Date: Feb 2018
Posts: 435
Reputation: 31
Default Little help with Pawn.CMD

Hey I was trying this command processor, but I've added this
PHP Code:
public OnPlayerCommandPerformed(playeridcmd[], params[], resultflags){
    if(
P[playerid][Logged] == false)return 1;
    if(
P[playerid][IsSpawned] == false)return 1;
    if(
result == -1)  {
        
SendClientMessage(playerid0xff0000ff"*SERVER {ffffff}Unknown command. Please refer to /help");
        return 
0;
    }    
    return 
1;

and it isn't sending me a message about unkown cmds.
Thanks in advance!
v1k1nG is offline   Reply With Quote
Old 14/09/2018, 04:04 PM   #2
Sithis
Gangsta
 
Join Date: Mar 2013
Location: the Netherlands
Posts: 887
Reputation: 79
Default Re: Little help with Pawn.CMD

Have you verified the callback is being called at all? Check that out first by placing a print() call above the first if statement.
__________________
Developer and owner of https://trinityrpg.com
Sithis is offline   Reply With Quote
Old 14/09/2018, 04:07 PM   #3
Undef1ned
Huge Clucker
 
Undef1ned's Avatar
 
Join Date: Aug 2018
Posts: 211
Reputation: 18
Default Re: Little help with Pawn.CMD

PHP Code:
public OnPlayerCommandPerformed(playeridcmd[], params[], resultflags)

    
printf("[CMD] %s"cmd); //you should check the console

    
if(!P[playerid][Logged]) return 1
    if(!
P[playerid][IsSpawned]) return 1;
    
    if(
result == -1)
    { 
        
SendClientMessage(playerid0xff0000ff"*SERVER {ffffff}Unknown command. Please refer to /help"); 
        return 
0
    }     
    return 
1

Undef1ned is offline   Reply With Quote
Old 14/09/2018, 04:19 PM   #4
v1k1nG
Huge Clucker
 
v1k1nG's Avatar
 
Join Date: Feb 2018
Posts: 435
Reputation: 31
Default Re: Little help with Pawn.CMD

Yes, it prints the commands I am entering
v1k1nG is offline   Reply With Quote
Old 14/09/2018, 04:21 PM   #5
Undef1ned
Huge Clucker
 
Undef1ned's Avatar
 
Join Date: Aug 2018
Posts: 211
Reputation: 18
Default Re: Little help with Pawn.CMD

PHP Code:
public OnPlayerCommandReceived(playeridcmd[], params[], flags
{
    if(!
P[playerid][Logged] || !P[playerid][IsSpawned]) return 0;
    return 
1;
}

public 
OnPlayerCommandPerformed(playeridcmd[], params[], resultflags)

    
printf("[CMD] %s"cmd);

    if(
result == -1)
    { 
        
SendClientMessage(playerid0xff0000ff"*SERVER {ffffff}Unknown command. Please refer to /help"); 
        return 
0
    }     
    return 
1

EDIT: A mistake
Undef1ned is offline   Reply With Quote
Old 14/09/2018, 04:36 PM   #6
v1k1nG
Huge Clucker
 
v1k1nG's Avatar
 
Join Date: Feb 2018
Posts: 435
Reputation: 31
Default Re: Little help with Pawn.CMD

Works indeed. Thanks!
v1k1nG is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Plugin] Vectoral Pawn - STL Data containers for pawn Rancho Plugin Development 69 26/03/2019 12:50 AM
Forum bug with [pawn][/pawn] BBCODE Yuripe Everything and Nothing 4 06/10/2012 01:58 PM
[Tool/Web/Other] PAWN Scanner - Scan PAWN files for information. Slice Tools and Files 10 15/07/2012 08:09 PM
[Help With Pawn] Pawn and compiler is not working..... D_Less Client Support 3 09/03/2012 05:49 AM


All times are GMT. The time now is 06:11 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.