SA-MP Forums

SA-MP Forums (
-   Help Archive (
-   -   Question on a making my own private message command. (

CaptainCaveMan 20/07/2008 07:53 AM

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.


Orpheus 20/07/2008 10:38 AM

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

CaptainCaveMan 21/07/2008 10:13 AM

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);
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...

ded 28/08/2009 04:07 PM

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 because it doesn't go there.

Hope this helps.

All times are GMT. The time now is 04:05 AM.

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