Question on a making my own private message command. -
CaptainCaveMan - 20.07.2008
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.
Re: Question on a making my own private message command. -
Orpheus - 20.07.2008
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
Re: Question on a making my own private message command. -
CaptainCaveMan - 21.07.2008
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 © 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...
Re: Question on a making my own private message command. -
ded - 28.08.2009
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.