SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 01/09/2019, 12:43 PM   #1
Z3nx31L
Little Clucker
 
Join Date: Aug 2019
Posts: 34
Reputation: 0
Default Help Me Pawn.CMD

PHP Code:
public OnPlayerCommandReceived(playeridcmd[], params[], flags
{
    
LoginCheck(playerid);
    if(
flags GENERAL_COMMAND)
    {
        if (!(
flags PlayerInfo[playerid][pAdmin]))
        {
            
AdminCheck(playeridflags);
            new 
string[1024], File:handle fopen("adminlog.txt"io_append);
            if(
strlen(params))
                
format(stringsizeof(string), "Admin: %s Using: /%s Params: %s On: %s\r\n"GetName(playerid), cmdparamsGetDate());
            else
                
format(stringsizeof(string), "Admin: %s Using: /%s On: %s\r\n"GetName(playerid), cmdGetDate());
            if(
handle)
            {
                
fwrite(handlestring);
                
fclose(handle);
                return 
1;
            }
        }
    }
    return 
1;

why when i use admin commands isshow the message you cant use admin commands but the commands is execute i want block it if not admin use this commands
__________________

Z3nx31L Is Here
Z3nx31L is offline   Reply With Quote
Old 01/09/2019, 05:49 PM   #2
Ejected
Big Clucker
 
Ejected's Avatar
 
Join Date: Jul 2012
Location: United States Discord: ABC#6701
Posts: 184
Reputation: 18
Default Re: Help Me Pawn.CMD

Show the AdminCheck function
Ejected is offline   Reply With Quote
Old 02/09/2019, 03:20 PM   #3
GTLS
High-roller
 
GTLS's Avatar
 
Join Date: Aug 2014
Location: India
Posts: 1,072
Reputation: 119
Default Re: Help Me Pawn.CMD

Show Enum of Flags, and make sure you have assigned the flags properly too. Also show where you have given specific player the flag permissions.
__________________

I don't help for rep. I help cuz I was helped in the past.


Retired from SAMP Scene. Might open SAMP Forums once in a while.

Some treats for ya. Click em
Basic House System
Simple Speedo
Base Login/Register Script

GTLS is offline   Reply With Quote
Old 02/09/2019, 04:39 PM   #4
Plastikmensch
Huge Clucker
 
Join Date: Aug 2016
Posts: 272
Reputation: 27
Default Re: Help Me Pawn.CMD

In order to block the execution of a command, you have to return 0.
Plastikmensch is offline   Reply With Quote
Old 04/09/2019, 12:33 PM   #5
Z3nx31L
Little Clucker
 
Join Date: Aug 2019
Posts: 34
Reputation: 0
Default Re: Help Me Pawn.CMD

Thx guys but when i put
SendClientMessage(..., ..., ...);
return 0;
is doenst work but if i delete SendClientMessage(..., ..., ...); is working.
__________________

Z3nx31L Is Here
Z3nx31L 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
[Tool/Web/Other] PAWN Fiddle - Share & run PAWN code online Peek Tools and Files 13 10/04/2019 07:12 PM
[Plugin] Vectoral Pawn - STL Data containers for pawn Rancho Plugin Development 69 25/03/2019 11:50 PM
[Tool/Web/Other] PAWN Scanner - Scan PAWN files for information. Slice Tools and Files 10 15/07/2012 07:09 PM
New to pawn, trying to convert some C code to pawn CHC Scripting Help 2 22/06/2012 05:09 AM
[HELP] [pawn][/pawn] bbcode for phpbb3 Kasura Help Archive 4 20/11/2010 04:35 AM


All times are GMT. The time now is 03:28 PM.


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