Z-Ammu FS -
ZukerCup - 07.03.2017
Z-Ammu FS
-Features
-DymanicCps
-CMD to teleport to the ammu fast if u are RCON Admin "/gotoammu"
-3DTEXTLABELS
-And u Can Find More
-Credits
Special Thanks To
-Zeex For ZCMD
-Incognito For Streamer
-The original FS maker ZukerCup
-Downloads
http://pastebin.com/UDtUQ2hP
http://www.mediafire.com/file/i3ol03...y_ZukerCup.zip
NOTE
To remove default checkpoints do this in your ongamemodeint or filterscriptint
Code:
DisableInteriorEnterExits();
Hope u Enjoy It and if u liked it, comment and REP+ Please. Thanks
Re: Z-Ammu FS -
TopShooter2 - 07.03.2017
Good but there's few things I noticed in the script, you know, optimizing the script is important part.
Instead of using these below;
PHP Code:
new ammu1;
new ammu2;
new ammu3;
Try making a variable like this below;
And use it like that
PHP Code:
ammu[0] = CreateDynamicCP( -2625.8235, 208.9246, 4.6171, 1.5, -1, -1, -1, 100.0);
ammu[1] = CreateDynamicCP( 316.3988, -169.4865, 999.6010, 1.5, -1, -1, -1, 100.0);
ammu[2] = CreateDynamicCP( 312.2126,-165.3139,999.6010, 1.5, -1, -1, -1, 100.0);
Same goes to the OnPlayerEnterDynamicCP.
And you could simply do the /gotoammu like that, just to make the script in less lines
PHP Code:
CMD:gotoammu(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "YOU ARE NOT RCON ADMIN");
SetPlayerPos(playerid, -2625.56, 213.69, 4.01);
return 1;
}
Try to optimize as much as possible, also I recommend defining the prices of each weapon instead of using them directly under OnDialogResponse, making it easier for others to edit the prices.
I'm not trying to dislike or hate it, i'm just advising you, nothing else. Anyways, good job as your first filterscript
Re: Z-Ammu FS -
berroni - 07.03.2017
Screenshots ?
Re: Z-Ammu FS -
RyderX - 07.03.2017
Good job ZuckerCup ;P
Re: Z-Ammu FS -
ZukerCup - 07.03.2017
Quote:
Originally Posted by TopShooter2
Good but there's few things I noticed in the script, you know, optimizing the script is important part.
Instead of using these below;
PHP Code:
new ammu1;
new ammu2;
new ammu3;
Try making a variable like this below;
And use it like that
PHP Code:
ammu[0] = CreateDynamicCP( -2625.8235, 208.9246, 4.6171, 1.5, -1, -1, -1, 100.0);
ammu[1] = CreateDynamicCP( 316.3988, -169.4865, 999.6010, 1.5, -1, -1, -1, 100.0);
ammu[2] = CreateDynamicCP( 312.2126,-165.3139,999.6010, 1.5, -1, -1, -1, 100.0);
Same goes to the OnPlayerEnterDynamicCP.
And you could simply do the /gotoammu like that, just to make the script in less lines
PHP Code:
CMD:gotoammu(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "YOU ARE NOT RCON ADMIN");
SetPlayerPos(playerid, -2625.56, 213.69, 4.01);
return 1;
}
Try to optimize as much as possible, also I recommend defining the prices of each weapon instead of using them directly under OnDialogResponse, making it easier for others to edit the prices.
I'm not trying to dislike or hate it, i'm just advising you, nothing else. Anyways, good job as your first filterscript
|
Thanks for advice
Re: Z-Ammu FS -
ZukerCup - 07.03.2017
Quote:
Originally Posted by RyderX
Good job ZuckerCup ;P
|
Thanks RyderX ☺
Re: Z-Ammu FS -
TitanX - 07.03.2017
Sorry, that isn't a work
Re: Z-Ammu FS -
Pottus - 07.03.2017
1-star from me we got shit loads of these scripts.
Re: Z-Ammu FS -
TitanX - 07.03.2017
Some Suggestions:
1- Not needed variables
PHP Code:
new gt = GetPlayerMoney(playerid);
using those variables make no sense(it's took memory) so better use native directly
like this:
PHP Code:
if(GetPlayerMoney(playerid) < 1500) return SendClientMessage(playerid, -1, "You Dont Have Enough Money!");
2- no sense
PHP Code:
ShowPlayerDialog(playerid,-1,0,"","","","");
this one will return some debug informations in console so better
3- Expressions
PHP Code:
if(dialogid == 2)
this is a old way to make a switch for ids and it's make complie time too long than normall (most unoticed)
so better use this
PHP Code:
switch(dialogid)
and for checking use case 0: or case 1:
and if you don't know id 1 or 0 in most gm's are already used, so that will make your dialogs unable to give back the informations and can make a crash in some cases
what to do ? use some ids +10k for make the ids confils impossible.
4 - The wrost idea ever
PHP Code:
public OnPlayerSpawn(playerid)
{
ammu1 = CreateDynamicCP( -2625.8235, 208.9246, 4.6171, 1.5, -1, -1, -1, 100.0);
Create3DTextLabel("[ENTER-AMMU]", COLOR_YELLOW, -2625.8235, 208.9246, 4.6171 + 0.2, 7.5, 0, 1);
ammu2 = CreateDynamicCP( 316.3988, -169.4865, 999.6010, 1.5, -1, -1, -1, 100.0);
Create3DTextLabel("[EXIT]", COLOR_YELLOW, 316.3988, -169.4865, 999.6010 + 0.2, 7.5, 0, 1);
ammu3 = CreateDynamicCP( 312.2126,-165.3139,999.6010, 1.5, -1, -1, -1, 100.0);
Create3DTextLabel("[BUY GUNS]", COLOR_YELLOW, 312.2126,-165.3139,999.6010 + 0.2, 7.5, 0, 1);
CreateActor( 179, 312.1635, -168.0826, 999.5938, 3.2477);
return 1;
}
making it on OnPlayerSpawn will create a CP and Text and a Actor every time a player spawn and that will make a BAD HOT Lag around the ammu can crash players and make them unable to access to it
so better change it to
PHP Code:
public OnFilterScriptInit()
5-about FSExit
as i see in your script you didn't touch OnFilterScriptExit(unused)
in this case when server owner reload the fs will create anothers 3DT and Actor and CP in same positions and that can make same for #4 and can get server bugged sometimes (crashes)
what to do ?
you need to destory the actor / cp / 3DT you should add a variable for every one of (Create*) as TopShooter2 said
using arrays ammu[2] ammu[3] etc
and using those functions:
PHP Code:
DestroyActor(actorid)
Delete3DTextLabel(Text3D:id)
DestroyDynamicCP(STREAMER_TAG_CP checkpointid)
@RyderX :/
Sorry, but i wouldn't say that is a nice job
Re: Z-Ammu FS -
RyderX - 08.03.2017
He's a a beginner so be easy with him, he could improve his scripts writing by the time, just give him some efforts

we all started as a beginners