29.08.2012, 08:48
(
Последний раз редактировалось IceMeteor; 29.08.2012 в 12:04.
)
aMe and aDo - For RP Server v1.0
by Ravian - IceMeteor
Introby Ravian - IceMeteor
My Second Filterscript, I got inspired from some of my friend that want this command. This command allow you to place /me and /do command, but as a 3D Text Label. The /ame is to describe about the character appearance, like what the character use. The 3DText will appear below our nametag. The /ado is to describe about the situation of the place, or to make a Sticker/Board in a place.
Videos and Screenshot
Commands
/ame - to create/update an aMe
/ame off - to delete an aMe
/ado - to create/update an aDo
/ado off - to delete an aDo
Needs
- ZCMD >> https://sampforum.blast.hk/showthread.php?tid=91354
- sscanf2 >> https://sampforum.blast.hk/showthread.php?tid=120356
- streamer >> https://sampforum.blast.hk/showthread.php?tid=102865
Install
- Open your pawno, hit New button
- Replace all text there with the code below
- Save it at the filterscripts folder as 'ameado.pwn'
- Compile it
- Open your server.cfg, add 'ameado' at the filterscript section
- Save the server.cfg, start the samp-server.exe
Make sure that you already place sscanf and streamer plugin.
And make sure that there's something printed on your console after loading the filterscipt
Код:
[19:36:59] Loading filterscript 'ameado.amx'... [19:36:59] ---------------------------------------------- [19:36:59] AME and ADO Filterscript by IceMeteor - Ravian [19:36:59] ----------------------------------------------
I haven't found any bugs yet, report here if you found one
Credits
All people that support this, direct or indirectly
Download
Pastebin
OR
pawn Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>
#include <streamer>
#define COLOR_ME 0xC2A2DAFF
#define COLOR_ERROR 0xFF0000FF
new Text3D:ame[MAX_PLAYERS];
new Text3D:ado[MAX_PLAYERS];
new amestatus[MAX_PLAYERS], adostatus[MAX_PLAYERS];
public OnFilterScriptInit()
{
print("\n-----------------------------------------------");
print(" AME and ADO Filterscript by IceMeteor - Ravian ");
print("-----------------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DestroyDynamic3DTextLabel(ado[playerid]);
DestroyDynamic3DTextLabel(ame[playerid]);
amestatus[playerid] = 0;
adostatus[playerid] = 0;
return 1;
}
GetRPName(playerid)
{
new RPName[MAX_PLAYER_NAME], i_pos;
GetPlayerName(playerid, RPName, MAX_PLAYER_NAME);
while ((i_pos = strfind(RPName, "_", false, i_pos)) != -1) RPName[i_pos] = ' ';
return RPName;
}
CMD:ame(playerid, params[])
{
new result[100], string[140];
if(sscanf(params, "s[100]", result))
{
SendClientMessage(playerid, COLOR_ERROR, "USAGE:{FFFFFF} /ame [description] - This text will show up above your head.");
SendClientMessage(playerid, COLOR_ERROR, "HINT:{FFFFFF} Use (/ame off) to remove the text!");
return 1;
}
if(strlen(result) >100) return SendClientMessage(playerid, COLOR_ERROR, "The description shouldn't more than 100 character!");
if(strcmp(result, "off", true) == 0)
{
if(amestatus[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You don't have any ame attached!");
DestroyDynamic3DTextLabel(ame[playerid]);
SendClientMessage(playerid, COLOR_ME, "AME deleted!");
amestatus[playerid] = 0;
return 1;
}
if(amestatus[playerid] == 0)
{
format(string, sizeof(string), "* %s %s *", GetRPName(playerid), result);
ame[playerid] = CreateDynamic3DTextLabel(string, COLOR_ME, 0.0, 0.0, 0.0, 40.0, playerid);
format(string, sizeof(string), "AME >> %s", string);
SendClientMessage(playerid, COLOR_ME, "You have attached an AME above your head!");
SendClientMessage(playerid, COLOR_ME, string);
amestatus[playerid] = 1;
}
else
{
format(string, sizeof(string), "* %s %s *", GetRPName(playerid), result);
UpdateDynamic3DTextLabelText(ame[playerid], COLOR_ME, string);
format(string, sizeof(string), "AME Update Success! >> %s", string);
SendClientMessage(playerid, COLOR_ME, string);
return 1;
}
return 1;
}
CMD:ado(playerid, params[])
{
new result[100], string[140];
if(sscanf(params, "s[200]", result))
{
SendClientMessage(playerid, COLOR_ERROR, "USAGE:{FFFFFF} /ado [description] - This text will stay on your current place.");
SendClientMessage(playerid, COLOR_ERROR, "HINT:{FFFFFF} Use (/ado off) to remove the text!");
return 1;
}
if(strlen(result) >100) return SendClientMessage(playerid, COLOR_ERROR, "The description shouldn't more than 100 character!");
if(strcmp(result, "off", true) == 0)
{
if(adostatus[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You don't have any ado attached!");
DestroyDynamic3DTextLabel(ado[playerid]);
SendClientMessage(playerid, COLOR_ME, "ADO deleted!");
adostatus[playerid] = 0;
return 1;
}
if(adostatus[playerid] == 0)
{
new Float:AdoX, Float:AdoY, Float:AdoZ;
GetPlayerPos(playerid, AdoX, AdoY, AdoZ);
format(string, sizeof(string), "* %s *\n(( %s ))", result, GetRPName(playerid));
ado[playerid] = CreateDynamic3DTextLabel(string, COLOR_ME, AdoX, AdoY, AdoZ, 40.0);
SendClientMessage(playerid, COLOR_ME, "You have attached an ADO at your current place!");
adostatus[playerid] = 1;
}
else
{
format(string, sizeof(string), "* %s *\n(( %s ))", result, GetRPName(playerid));
UpdateDynamic3DTextLabelText(ado[playerid], COLOR_ME, string);
SendClientMessage(playerid, COLOR_ME, "ADO Update Success!");
return 1;
}
return 1;
}