SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 26/05/2019, 06:21 PM   #1
binnyl
Huge Clucker
 
Join Date: Aug 2017
Posts: 204
Reputation: 6
Default OnPlayerTakePhoto

I've tried to somehow detect when players take a photo, but it isn't working
Is anybody can help me? i dindn't found it in no where

Inside of OnPlayerKeyStateChange
PHP Code:
        if(newkeys == KEY_FIRE)
        {
            
// OnPlayerTakePhoto
            
if(GetPlayerCameraMode(playerid) == 46)
            {
                
printf("photo"); 
It isn't print "photo"
binnyl is offline   Reply With Quote
Old 27/05/2019, 07:29 PM   #2
binnyl
Huge Clucker
 
Join Date: Aug 2017
Posts: 204
Reputation: 6
Default Re: OnPlayerTakePhoto

bump
binnyl is offline   Reply With Quote
Old 29/05/2019, 02:07 AM   #3
binnyl
Huge Clucker
 
Join Date: Aug 2017
Posts: 204
Reputation: 6
Default Re: OnPlayerTakePhoto

bump
binnyl is offline   Reply With Quote
Old 29/05/2019, 02:40 AM   #4
RogueDrifter
High-roller
 
RogueDrifter's Avatar
 
Join Date: Dec 2017
Location: SA-MP Drifting world.
Posts: 1,178
Reputation: 397
Default Re: OnPlayerTakePhoto

Try replacing
pawn Code:
newkeys == KEY_FIRE
with
pawn Code:
KEY_PRESSED(KEY_FIRE)
and put this on the top of your script:
pawn Code:
#define KEY_PRESSED(%0) \
                    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
__________________
Quote:
Originally Posted by Andy
My anti cheat is still relevant *puts shades on* https://github.com/RogueDrifter/Anti_cheat_pack

[Github]:Link [Gists]:Link [Forum]:Link [Server]:Link [Discord]:Link
RogueDrifter is offline   Reply With Quote
Old 29/05/2019, 09:49 AM   #5
raydx
Huge Clucker
 
raydx's Avatar
 
Join Date: Feb 2017
Posts: 205
Reputation: 73
Default Re: OnPlayerTakePhoto

Wrong condition.

if(newkeys == KEY_FIRE) > if(newkeys & KEY_FIRE)
raydx is offline   Reply With Quote
Old 31/05/2019, 05:19 AM   #6
binnyl
Huge Clucker
 
Join Date: Aug 2017
Posts: 204
Reputation: 6
Default Re: OnPlayerTakePhoto

Thank you guys, i gave you a rep
binnyl 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



All times are GMT. The time now is 09:49 PM.


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