[FilterScript] Essentials [17.04.2013]
#1

Prezentare in limba romana: http://forum.sa-mp.com/showthread.ph...07#post2486007

Essentials


What is "Essentials"?
Well, a filterscript which contains some "essential" commands and teleports.

Bugs
I didn't find any bug. PM me or post here if you found one.

Pics
http://postimg.org/gallery/5ts9up9c/

Commands
/ESHelp, /ESCmds, /ESTeles,
/Skin, /Dive, /Para, /Camera, /Flowers, /Dildo, /Kill,
/DrunkOff, /Nrg, /Beer, /Wine, /Soda, /Cigar, /Day,
/Night, /Morning, /Evening, /AFall, /SB, /Vup.

Teleports
/LS, /SF, /LV, /MC, /Beach, /Casino, /AA, /LSAir,
/LVAir, /SFAir, /Vinewood, /TransFender, /LocoLow, /WheelArch, /Grove.

Extras
If you write something in chat, will appear your ID and "(RCON Admin)" tag if you are logged as RCON.
If you press "2", your car will be repaired.
If you press "Y", your car will be flipped.

Download
Pastebin: Click here!

Reply
#2

You should re-factor your teleport commands since all the code is basically the same.

Before

pawn Код:
CMD:vinewood(playerid)
{
        new string[256], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string,sizeof string,"%s {FFFFFF}has gone to {33AA33}Vinewood (/vinewood)",pName);
        SendClientMessageToAll(green,string);
        if (IsPlayerInAnyVehicle(playerid))
        {
                SetVehiclePos(GetPlayerVehicleID(playerid), 1413.2775,-871.3857,46.9813);
                LinkVehicleToInterior(GetPlayerVehicleID(playerid), 0);
        }
        if (!IsPlayerInAnyVehicle(playerid))
        {
                SetPlayerPos(playerid, 1413.2775,-871.3857,46.9813);
                SetPlayerInterior(playerid, 0);
        }
        return 1;
}
After

pawn Код:
CMD:vinewood(playerid) { TeleportPlayer(playerid, "Vinewood", "Vinewood", 1413.2775,-871.3857,46.9813, 0); return 1; }
CMD:lvair(playerid) { TeleportPlayer(playerid, "Las Venturas Airport", "lvair", 1318.8335,1255.4017,10.8203, 0); return 1; }

stock TeleportPlayer(playerid, LocationName[], LocationCommand[], Float:LocX, Float:LocY, Float:LocZ, InteriorID)
{
        new string[128], pName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
        format(string,sizeof string,"%s {FFFFFF}has gone to {33AA33}%s(/%s)",pName, LocationName, LocationCommand);
        SendClientMessageToAll(green,string);
        if (IsPlayerInAnyVehicle(playerid))
        {
                SetVehiclePos(GetPlayerVehicleID(playerid), LocX,LocY,LocZ);
                LinkVehicleToInterior(GetPlayerVehicleID(playerid), InteriorID);
        }
        if (!IsPlayerInAnyVehicle(playerid))
        {
                SetVehiclePos(GetPlayerVehicleID(playerid), LocX,LocY,LocZ);
                SetPlayerInterior(playerid, InteriorID);
        }
        return 1;
}
I don't know about you but that will save a lot of lines of code and also make it really easy to add more locations without bloating your script with copy/paste code.

One more thing

SendClientMessage(playerid,green,"ES Message: {FFFFFF}You've setted your time to {33AA33} 12:00!");

There is no such word as "setted" in the English language it would simply be "set".
Reply
#3

Thanks and sorry for my English!
Reply
#4

Код:
        if (IsPlayerInAnyVehicle(playerid))
        {
                SetVehiclePos(GetPlayerVehicleID(playerid), LocX,LocY,LocZ);
                LinkVehicleToInterior(GetPlayerVehicleID(playerid), InteriorID);
        }
        if (!IsPlayerInAnyVehicle(playerid))
        {
                SetVehiclePos(GetPlayerVehicleID(playerid), LocX,LocY,LocZ);
                SetPlayerInterior(playerid, InteriorID);
        }
Why lol?

Код:
        if (IsPlayerInAnyVehicle(playerid))
        {
                SetVehiclePos(GetPlayerVehicleID(playerid), LocX,LocY,LocZ);
                LinkVehicleToInterior(GetPlayerVehicleID(playerid), InteriorID);
        }
        else
        {
                SetVehiclePos(GetPlayerVehicleID(playerid), LocX,LocY,LocZ);
                SetPlayerInterior(playerid, InteriorID);
        }
you call two times the same native
Reply
#5

Seems like he is still learning.

Good job with it.
Reply
#6

Modified
Thanks for reporting that bug. I didn't see that.
Reply
#7

I've see much new string[256] for output messages, change it to [128] or (much better) resize the size according to the message..
Reply
#8

Good job, keep up the good work !
Reply
#9

This idea is stolen, it was made a long time ago by an user name "Sellize". Goob job though
Reply
#10

Quote:
Originally Posted by NicholasA
Посмотреть сообщение
This idea is stolen, it was made a long time ago by an user name "Sellize". Goob job though
Well, the name is stolen from a plugin for Minecraft. (http://dev.bukkit.org/server-mods/essentials/)
And Sellize made commands like /kick /ban (like a mini-admin system) etc so, this is different.

Thanks.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)