[FilterScript] [MySQL] Shot recorder - Records shot with appropriate bodytype
#1

Shot Recorder
Version: v0.1
Last updated: N/A
Description

This filterscript allows to you save all the shots a player shot and saves them with the bodypart type.

Media



Features
  • See all your shots in /shots (or other's shots with /shots [ID])
  • Easily edited
  • Uses MySQL R39-6 by BlueG
  • User friendly
  • Readablilty
  • Good performance
Credits

AjaxM - The script
SA-MP Team - SA-MP
BlueG - MySQL
Yashas / Zeex - I-ZCMD
Pottus - Pointed out things to be fixed
oMa37 - Pointed out the fix for github

Bugs

Tested ; No bugs found.

Table Creation

You should manually create the table with the following code:

PHP Code:
CREATE TABLE `YOUR_PORT_HERE`.`ShotRecords`(
    `
IDINT(15NOT NULL AUTO_INCREMENT ,
    `
NameVARCHAR(25NOT NULL ,
    `
ChestINT(11NOT NULL ,
    `
TorsoINT(11NOT NULL ,
    `
LeftArmINT(11NOT NULL ,
    `
RightArmINT(11NOT NULL ,
    `
LeftLegINT(11NOT NULL ,
    `
RightLegINT(11NOT NULL ,
    `
HeadINT(11NOT NULL ,
    `
MissedINT(15NOT NULL ,
    
PRIMARY KEY  (`ID`))
    
ENGINE InnoDB
Note: You should change the 'YOUR_PORT_HERE' to your database port.

Download

GITHUB

Thanks & enjoy.
Reply
#2

good job this is acutally pretty nice
Reply
#3

What is this bullshit?

Code:
        if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_CHEST)
	{
	    pInfo[issuerid][Chest] += 1;
	}
	if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_TORSO)
	{
	    pInfo[issuerid][Torso] += 1;
	}
	if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_LEFT_ARM)
	{
	    pInfo[issuerid][LeftArm] += 1;
	}
	if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_RIGHT_ARM)
	{
	    pInfo[issuerid][RightArm] += 1;
	}
	if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_LEFT_LEG)
	{
	    pInfo[issuerid][LeftLeg] += 1;
	}
	if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_RIGHT_LEG)
	{
	    pInfo[issuerid][RightLeg] += 1;
	}
	if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_HEAD)
	{
	    pInfo[issuerid][Head] += 1;
	}
Do it like this.

Code:
	if(issuerid != INVALID_PLAYER_ID)
	{
	    switch(bodypart)
	    {
	        case WEAPON_BODY_PART_CHEST: pInfo[issuerid][Chest] += 1;
	        case WEAPON_BODY_PART_TORSO: pInfo[issuerid][Torso] += 1;
	        case WEAPON_BODY_PART_LEFT_ARM: pInfo[issuerid][LeftArm] += 1;
	        case WEAPON_BODY_PART_RIGHT_ARM: pInfo[issuerid][RightArm] += 1;
	        case WEAPON_BODY_PART_LEFT_LEG: pInfo[issuerid][RightLeg] += 1;
	        case WEAPON_BODY_PART_RIGHT_LEG: pInfo[issuerid][LeftLeg] += 1;
	        case WEAPON_BODY_PART_HEAD: pInfo[issuerid][Head] += 1;
	    }
	}
Reply
#4

Interesting release
Why the code looks so messed up at GitHub? I had the same problem 2 days ago, there must be a fix for it
Reply
#5

Quote:
Originally Posted by JustMe.77
View Post
Why the code looks so messed up at GitHub? I had the same problem 2 days ago, there must be a fix for it
Don't upload the .pwn file directly from your PC to the GitHub repository, Follow these steps;

Open your repository -> Click 'Create new file' -> Name your file and at the end of the name put .pwn -> Copy your script and paste it in the new file you made.

or simply, if you use Sublime Text 3, Open 'View' -> 'Line Endings' -> 'Unix' then save it and upload it to the repository.

Though, I believe there are other simpler ways.


OT: Simple, But there are few things you should note on, such as the string defines in the command and Pottus post.
Reply
#6

Quote:
Originally Posted by oMa37
View Post
Don't upload the .pwn file directly from your PC to the GitHub repository, Follow these steps;

or simply, if you use Sublime Text 3, Open 'View' -> 'Line Endings' -> 'Unix' then save it and upload it to the repository.
First step wasn't helping, but the last one does, thanks !

And yea, improve those little things Pottus have mentioned.
Reply
#7

Quote:
Originally Posted by JustMe.77
View Post
First step wasn't helping, but the last one does, thanks !
You must have done a wrong step, It usually work fine with me the first step.
Anyway, Glad it worked.
Reply
#8

Quote:
Originally Posted by ItzzWesty
View Post
good job this is acutally pretty nice
Thanks!

Quote:
Originally Posted by Pottus
View Post
What is this bullshit?

Code:
        if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_CHEST)
	{
	    pInfo[issuerid][Chest] += 1;
	}
	if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_TORSO)
	{
	    pInfo[issuerid][Torso] += 1;
	}
	if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_LEFT_ARM)
	{
	    pInfo[issuerid][LeftArm] += 1;
	}
	if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_RIGHT_ARM)
	{
	    pInfo[issuerid][RightArm] += 1;
	}
	if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_LEFT_LEG)
	{
	    pInfo[issuerid][LeftLeg] += 1;
	}
	if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_RIGHT_LEG)
	{
	    pInfo[issuerid][RightLeg] += 1;
	}
	if(issuerid != INVALID_PLAYER_ID && bodypart == WEAPON_BODY_PART_HEAD)
	{
	    pInfo[issuerid][Head] += 1;
	}
Do it like this.

Code:
	if(issuerid != INVALID_PLAYER_ID)
	{
	    switch(bodypart)
	    {
	        case WEAPON_BODY_PART_CHEST: pInfo[issuerid][Chest] += 1;
	        case WEAPON_BODY_PART_TORSO: pInfo[issuerid][Torso] += 1;
	        case WEAPON_BODY_PART_LEFT_ARM: pInfo[issuerid][LeftArm] += 1;
	        case WEAPON_BODY_PART_RIGHT_ARM: pInfo[issuerid][RightArm] += 1;
	        case WEAPON_BODY_PART_LEFT_LEG: pInfo[issuerid][RightLeg] += 1;
	        case WEAPON_BODY_PART_RIGHT_LEG: pInfo[issuerid][LeftLeg] += 1;
	        case WEAPON_BODY_PART_HEAD: pInfo[issuerid][Head] += 1;
	    }
	}
Improved, thanks. (Added to credits)

Quote:
Originally Posted by oMa37
View Post
Don't upload the .pwn file directly from your PC to the GitHub repository, Follow these steps;

Open your repository -> Click 'Create new file' -> Name your file and at the end of the name put .pwn -> Copy your script and paste it in the new file you made.

or simply, if you use Sublime Text 3, Open 'View' -> 'Line Endings' -> 'Unix' then save it and upload it to the repository.

Though, I believe there are other simpler ways.


OT: Simple, But there are few things you should note on, such as the string defines in the command and Pottus post.
Thanks, this is fixed. (Added to credits)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)