[FilterScript] [MySQL] Shot recorder - Records shot with appropriate bodytype
#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


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)