[FilterScript] Z-Ammu FS
#1

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
Reply
#2

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;

PHP Code:
new ammu[2]; 
And use it like that

PHP Code:
    ammu[0] = CreateDynamicCP( -2625.8235208.92464.61711.5, -1, -1, -1100.0);
    
ammu[1] = CreateDynamicCP316.3988, -169.4865999.60101.5, -1, -1, -1100.0);
    
ammu[2] = CreateDynamicCP312.2126,-165.3139,999.60101.5, -1, -1, -1100.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(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"YOU ARE NOT RCON ADMIN");
    
SetPlayerPos(playerid, -2625.56213.694.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
Reply
#3

Screenshots ?
Reply
#4

Good job ZuckerCup ;P
Reply
#5

Quote:
Originally Posted by TopShooter2
View Post
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;

PHP Code:
new ammu[2]; 
And use it like that

PHP Code:
    ammu[0] = CreateDynamicCP( -2625.8235208.92464.61711.5, -1, -1, -1100.0);
    
ammu[1] = CreateDynamicCP316.3988, -169.4865999.60101.5, -1, -1, -1100.0);
    
ammu[2] = CreateDynamicCP312.2126,-165.3139,999.60101.5, -1, -1, -1100.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(playeridparams[])
{
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"YOU ARE NOT RCON ADMIN");
    
SetPlayerPos(playerid, -2625.56213.694.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
Reply
#6

Quote:
Originally Posted by RyderX
View Post
Good job ZuckerCup ;P
Thanks RyderX ☺
Reply
#7

Sorry, that isn't a work
Reply
#8

1-star from me we got shit loads of these scripts.
Reply
#9

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

PHP Code:
else return 1
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.8235208.92464.61711.5, -1, -1, -1100.0);
    
Create3DTextLabel("[ENTER-AMMU]"COLOR_YELLOW, -2625.8235208.92464.6171 0.27.501);
    
ammu2 CreateDynamicCP316.3988, -169.4865999.60101.5, -1, -1, -1100.0);
    
Create3DTextLabel("[EXIT]"COLOR_YELLOW316.3988, -169.4865999.6010 0.27.501);
    
ammu3 CreateDynamicCP312.2126,-165.3139,999.60101.5, -1, -1, -1100.0);
    
Create3DTextLabel("[BUY GUNS]"COLOR_YELLOW312.2126,-165.3139,999.6010 0.27.501);
    
CreateActor179312.1635, -168.0826999.59383.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
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)