[FilterScript] Z-Ammu FS
#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


Messages In This Thread
Z-Ammu FS - by ZukerCup - 07.03.2017, 18:17
Re: Z-Ammu FS - by TopShooter2 - 07.03.2017, 19:14
Re: Z-Ammu FS - by berroni - 07.03.2017, 19:16
Re: Z-Ammu FS - by RyderX - 07.03.2017, 19:36
Re: Z-Ammu FS - by ZukerCup - 07.03.2017, 19:44
Re: Z-Ammu FS - by ZukerCup - 07.03.2017, 19:46
Re: Z-Ammu FS - by TitanX - 07.03.2017, 19:52
Re: Z-Ammu FS - by Pottus - 07.03.2017, 19:55
Re: Z-Ammu FS - by TitanX - 07.03.2017, 20:05
Re: Z-Ammu FS - by RyderX - 08.03.2017, 17:27

Forum Jump:


Users browsing this thread: 1 Guest(s)