SA-MP Forums Archive
[FilterScript] San Andreas Singleplayer cheats[cmd based and text based] - 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] San Andreas Singleplayer cheats[cmd based and text based] (/showthread.php?tid=434809)

Pages: 1 2


San Andreas Singleplayer cheats[UPDATED TO V2.0] - Rayan_black - 04.05.2013


Explanations
-It's just I was messing the old days in SA Singleplayer, and though of bringing them back with this filterscript, this one will give you the ability to use the OLD cheats in SA-MP, not all of them but the few possible cheats only, it can be disabled or enabled by a command, and it's command based or text based aswell, the picture above show it all.

Commands
lxgiwyl - Weapon pack 1
professionalskit - Weapon pack 2
hesoyam - Armour + Health + 250,000$
goodbyecruelworld - Kill your self.
baguvix - Can't be killed.
aiwprton - Tank
cqzijmb - Blooding Banger
jqntdmh - Ranger
vrockpokey - Horing Racer #1
vpjtqwv - Horing Racer #2
celebritystatus - Limousin Stretch
truegrime - Trash truck
rzhsuew - Taxi
ohdude - Hunter
monstermash - Monster car
jumpjet - Hydra
rocketman - Jetpack
aiypwzpq - Parachute
pleasantlywarm - Good weather
alnsfmzo - Bad weather
cfvfgmj - Orange weather
cwjxuoc - Sable
cheatslist - Shows you all the cheats
cheats - to disable or enable the text based cheats
Installation
-Copy both SA_CHEATS.amx and SA_CHEATS.pwn to your fiterscript directory.
-Make sure you have zcmd inculde.
-Open your server file and add SA_CHEATS in filterscripts line.
-and viola enjoy.
Credits
-Hoss: For some useful tips (thanks bro <3)
-Kye: For SA-MP.
-Zeex: For ZCMD.
Improvements
-No more bugs.
-The Textdraws works perfectly now.
-More orgenized script.
Download
V2.0:
Pasteben
Mediafire
Enjoy



Re: San Andreas Singleplayer cheats[cmd based and text based] - JaKe Elite - 04.05.2013

If there is only a function that can make all buttons in the keyboard detectable.
Then it can be make it possible without using Chat Key ('T') then type the cheat code.


Re : San Andreas Singleplayer cheats[cmd based and text based] - Rayan_black - 04.05.2013

Indeed, I heard they're considering making that function in 0.4..


Re: San Andreas Singleplayer cheats[cmd based and text based] - Hoss - 04.05.2013

Nicely done
Good job


Re : San Andreas Singleplayer cheats[cmd based and text based] - Rayan_black - 04.05.2013

thanks hossy


Re: San Andreas Singleplayer cheats[cmd based and text based] - JSkulloz - 04.05.2013

nice 0.0


Re: San Andreas Singleplayer cheats[cmd based and text based] - Jasem - 04.05.2013

Good job on this one. :3


Re : San Andreas Singleplayer cheats[cmd based and text based] - Rayan_black - 04.05.2013

Thanks guys :3


Re: San Andreas Singleplayer cheats[cmd based and text based] - MP2 - 04.05.2013

Not good I'm afraid. Why is a filterscript interfering with OnPlayerRequestClass? Why are processed commands returning 0? They should return 1. Why are you checking the 'canusecheats' variable for every command? You only need it once.

Also, the 'Cheat Activated' TD is stretched.


Re : Re: San Andreas Singleplayer cheats[cmd based and text based] - Rayan_black - 04.05.2013

Quote:
Originally Posted by MP2
View Post
Not good I'm afraid. Why is a filterscript interfering with OnPlayerRequestClass? Why are processed commands returning 0? They should return 1. Why are you checking the 'canusecheats' variable for every command? You only need it once.

Also, the 'Cheat Activated' TD is stretched.
Just forgot to delete it, not a big problem... I use basic ways and I don't make my filterscript complecated, it's for newbies I coded everything in a simple way and the commands are returning 1, but the text is returning 0 because it will return to false value when checking if he wrote it.


Re: San Andreas Singleplayer cheats[cmd based and text based] - exodus94 - 04.05.2013

Great job, I like it


Re: San Andreas Singleplayer cheats[cmd based and text based] - billy123321 - 04.05.2013

Very high quality, the best filter-script I've ever seen. I'm now using it in my server, thank you so much sir!


Re : San Andreas Singleplayer cheats[cmd based and text based] - tik.tok.rok - 04.05.2013

Nice !


Re: San Andreas Singleplayer cheats[cmd based and text based] - Strier - 04.05.2013

Useful, rep+


Re : San Andreas Singleplayer cheats[cmd based and text based] - Rayan_black - 04.05.2013

Thanks, btw read the server's name


Re: San Andreas Singleplayer cheats[cmd based and text based] - CaGamingLTD - 05.05.2013

dont cheat play legit


Re: San Andreas Singleplayer cheats[cmd based and text based] - ahmad95 - 05.05.2013

Nice job, well done!


Re: San Andreas Singleplayer cheats[cmd based and text based] - CreativityLacker - 06.05.2013

I'm afraid it's too inefficient.

First of all, you're using an ENUM for a SINGLE variable

pawn Код:
enum cInfo
{
bool:CanUseCheats
}
new Cheats[MAX_PLAYERS][cInfo];
CAN simply be

pawn Код:
new bool:CanUseCheats[MAX_PLAYERS];

ANND

pawn Код:
public OnPlayerText(playerid, text[])
{
        if(strcmp("lxgiwyl",text,true,1) == 0 &&  Cheats[playerid][CanUseCheats] == true)
        {
        GivePlayerWeapon(playerid, 5, 1);
        GivePlayerWeapon(playerid, 22, 999);
        GivePlayerWeapon(playerid, 25, 999);
        GivePlayerWeapon(playerid, 28, 999);
        GivePlayerWeapon(playerid, 35, 999);
        GivePlayerWeapon(playerid, 18, 999);
        CheatTD(playerid);
        return 0;
        }
}
Can simply be

pawn Код:
public OnPlayerText(playerid, text[])
{
        if(strcmp("lxgiwyl",text,true,1) == 0 &&  Cheats[playerid][CanUseCheats] == true)
        {
        cmd_lxgiwyl(playerid, "");
        return 0;
        }
}

ALSOOOOO
pawn Код:
stock CheatTD(playerid)
{
        TextDrawShowForPlayer(playerid, cheattd);
        SetTimer("EndCheat", 5000, false);
        return 1;
}
IS PLAIN WRONG

because

pawn Код:
public EndCheat(playerid)
{
        TextDrawHideForPlayer(playerid, cheattd);
        return 1;
}
has a parameter.

And using TIMERS with parameters requires you to use SetTimerEx

SOOO

we change

pawn Код:
stock CheatTD(playerid)
{
        TextDrawShowForPlayer(playerid, cheattd);
        SetTimer("EndCheat", 5000, false);
        return 1;
}
this
to
pawn Код:
stock CheatTD(playerid)
{
        TextDrawShowForPlayer(playerid, cheattd);
        SetTimerEx("EndCheat", 5000, false, "d", playerid);
        return 1;
}
BUT, I do like the idea of implementing the single-player cheats like this using OnPlayerText.

Some points I'd like to see improved -

Better indentation
Usage of array's
custom cheat ID's
permissions for using EACH cheat SEPARATELY for each player


Re: San Andreas Singleplayer cheats[cmd based and text based] - ahmad95 - 06.05.2013

Nice!


Re: San Andreas Singleplayer cheats[cmd based and text based] - Mark_Samp - 06.05.2013

Good job dude