SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 20/07/2008, 07:53 AM   #1
CaptainCaveMan
Little Clucker
 
Join Date: Mar 2008
Posts: 4
Reputation: 0
Default Question on a making my own private message command.

Hey, Im wanting to make my own private message command that only admin level 10 can read and use... I want the command to be used like /apm <id> [message]

Im very very new to scripting so if someone can explain to me in detail how to do it that would be great


I also wondered if theres a way, when enabling AllowAdminTeleport can you teleport with your vehicle? instead of leaving that behind.


Thanks.
CaptainCaveMan is offline  
Old 20/07/2008, 10:38 AM   #2
Orpheus
Little Clucker
 
Join Date: May 2008
Posts: 42
Reputation: 0
Default Re: Question on a making my own private message command.

You can tele with your vehicle use SetVehiclePos rather than SetPlayerPos

as for the /apm yeah its possible i have one similar if you would like to look at it, pm me and i'll send you it to look at

alternativly you can use strval to make strval(tmp) to = the playerid, and strval(tmp2) to be the message, sort of thing,

maybe look at a /report thats a good way to do it, cos that uses playerid's and message alrealdy but you'll hve to do a new string[256]; and string = strval(tmp2) to make it so it will send COUSTOM messages rather than a pre detirmined one
Orpheus is offline  
Old 21/07/2008, 10:13 AM   #3
CaptainCaveMan
Little Clucker
 
Join Date: Mar 2008
Posts: 4
Reputation: 0
Default Re: Question on a making my own private message command.

This is what i came up with so far...

}
dcmd_apm(playerid,params[])( {
if(IsPlayerCommandLevel(playerid,"apm")) return false SendClientMessage(playerid,red,"ERROR, You must be admin Level 10 to use this command.");
OnAdminPrivmsg(playerid, recieverid, text[]) {
if(!IsPlayerConnected(playerid)||!IsPlayerConnecte d(recieverid)) return 1;
new string[256], ToName[24], Name[24]; GetPlayerName(playerid,Name,24);
GetPlayerName(recieverid,ToName,24);
format (string,256,"APM: %s [%d] -> %s [%d]: %s",Name,playerid,ToName,recieverid,text);
}

im getting this error report when i try to compile it.

--------------------------------------------------------------------------------------------------------
Admin.pwn(11) : fatal error 100: cannot read from file: "adminprivmsg"

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
--------------------------------------------------------------------------------------------------------

So i tried adding this to a_samp.pwn

forward OnAdminPrivmsg(playerid, recieverid, text[]);

I'm not sure what else i can do...
CaptainCaveMan is offline  
Old 28/08/2009, 04:07 PM   #4
ded
Gangsta
 
ded's Avatar
 
Join Date: Jun 2009
Location: We comin' through dumpin'
Posts: 543
Reputation: 0
Default Re: Question on a making my own private message command.

Uhhh, well ... this compile error ... have you included a file called "adminprivmsg" if so, that file is non existent or not in the pawno folder. Also, OnAdminPrivmsg is not a native function so i'm assuming you have created and forwarded it already? If not, do so. If you have, take the forward out of a_samp.inc because it doesn't go there.

Hope this helps.
__________________
ded is offline  
 

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
[Problem] Private Message Advirtising! -PunisheR- Help Archive 6 06/11/2009 02:18 PM
Private Message XeoN_13 Help Archive 20 18/10/2009 06:00 PM


All times are GMT. The time now is 03:53 AM.


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