SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 11/01/2019, 06:36 PM   #1
rockys
Little Clucker
 
Join Date: Oct 2018
Location: Romania
Posts: 26
Reputation: 0
Default how to send admin message from include

how can i send message to admins from include

how to get PlayInfo from gamemode?
PlayerInfo[playerid][pAdmin]?
rockys is offline   Reply With Quote
Old 11/01/2019, 06:40 PM   #2
Banditul18
Huge Clucker
 
Join Date: Nov 2014
Location: Brasov,Romania
Posts: 358
Reputation: 32
Default Re: how to send admin message from include

If you include that include (kinda ironic) after the PlayerInfo definition you can access the information that is there
__________________
Banditul18 is online now   Reply With Quote
Old 11/01/2019, 07:03 PM   #3
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,518
Reputation: 3207
Default Re: how to send admin message from include

Don't.

1) Move all the admin features in to one file, including the variable that stores whether they are an admin. Your player information should be spread out, not all shoved in to one place.

2) Don't ever access variables from other files. Declared all globals `static` so the compiler can ensure this.

3) Just use functions to access information. So if you need to know if someone is an admin, just do `if (IsPlayerMyAdmin(playerid))`.
Y_Less is online now   Reply With Quote
Old 11/01/2019, 07:25 PM   #4
rockys
Little Clucker
 
Join Date: Oct 2018
Location: Romania
Posts: 26
Reputation: 0
Default Re: how to send admin message from include

hmm

static variables in gamemode is avaible in all include?
rockys is offline   Reply With Quote
Old 11/01/2019, 09:11 PM   #5
userid
Little Clucker
 
Join Date: Aug 2018
Location: Where you live
Posts: 36
Reputation: 4
Default Re: how to send admin message from include

You can use pvars https://wiki.sa-mp.com/wiki/Category...es_.28pVars.29
userid is offline   Reply With Quote
Old 11/01/2019, 09:14 PM   #6
Y_Less
Beta Tester
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 15,518
Reputation: 3207
Default Re: how to send admin message from include

No. Re-read what I said. The variable being unavailable is explicitly the point of using static. It separates concerns and makes code more modular and isolated.
Y_Less is online now   Reply With Quote
Old 12/01/2019, 11:32 PM   #7
rockys
Little Clucker
 
Join Date: Oct 2018
Location: Romania
Posts: 26
Reputation: 0
Default Re: how to send admin message from include

ty for suport, i use CallLocalFunction to send admin message
rockys is offline   Reply With Quote
Old 13/01/2019, 01:04 PM   #8
L0K3D
Little Clucker
 
L0K3D's Avatar
 
Join Date: Apr 2015
Location: Republic of Moldova
Posts: 34
Reputation: 0
Default Re: how to send admin message from include

You can create a include with your vars, enums, etc and include it in your gamemode or another include.
L0K3D 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
How to Send Admin Message ? Jhony_Blaze Scripting Help 8 11/12/2014 06:31 PM
[Help] Send Admin Message for Forbidden words David (Sabljak) Scripting Help 2 15/01/2013 12:55 PM
Send to admin other message and to player other message lonako45 Scripting Help 10 24/04/2012 01:35 PM
how to send message to admin with command OmarEco Help Archive 1 08/07/2010 11:52 AM


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


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