SA-MP Forums Archive
[FilterScript] Essentials [17.04.2013] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Essentials [17.04.2013] (/showthread.php?tid=431221)



Essentials [17.04.2013] - [Ro]DuReX - 17.04.2013

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!




Re: Essentials [17.04.2013] - Pottus - 17.04.2013

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".


Re: Essentials [17.04.2013] - [Ro]DuReX - 17.04.2013

Thanks and sorry for my English!


Re: Essentials [17.04.2013] - ReVo_ - 17.04.2013

Код:
        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


Re: Essentials [17.04.2013] - -CaRRoT - 17.04.2013

Seems like he is still learning.

Good job with it.


Re: Essentials [17.04.2013] - [Ro]DuReX - 17.04.2013

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


Re: Essentials [17.04.2013] - ReVo_ - 17.04.2013

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


Re: Essentials [17.04.2013] - Red_Dragon. - 17.04.2013

Good job, keep up the good work !


Re: Essentials [17.04.2013] - NicholasA - 17.04.2013

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


Re: Essentials [17.04.2013] - [Ro]DuReX - 17.04.2013

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.