Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetSkinBeard(skinid), GetSkinHat(skinid) #6

Open
Crayder opened this issue Sep 11, 2016 · 1 comment
Open

GetSkinBeard(skinid), GetSkinHat(skinid) #6

Crayder opened this issue Sep 11, 2016 · 1 comment
Labels

Comments

@Crayder
Copy link
Owner

Crayder commented Sep 11, 2016

Both boolean.

Use a simple script to do these. Concept code:

#include a_samp
#include strlib

new bool:skinHasHat[312], bool:skinHasBeard[312], currIndex;

main() {
    AddPlayerClass(0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
    if(newkeys & KEY_SPRINT) {
        currIndex++;
        if(currIndex == 312)
            currIndex = 0;

        SetPlayerSkin(playerid, currIndex);
    }

    else if(newkeys & KEY_YES || newkeys & KEY_NO) {
        skinHasHat[currIndex] = !!(newkeys & KEY_YES);
        SendClientMessage(playerid, (newkeys & KEY_YES) ? 0x00FF00FF : 0xFF0000FF, "Hat");
    }
    else if(newkeys & KEY_CTRL_BACK || newkeys & KEY_WALK) {
        skinHasBeard[currIndex] = !!(newkeys & KEY_CTRL_BACK);
        SendClientMessage(playerid, (newkeys & KEY_CTRL_BACK) ? 0x00FF00FF : 0xFF0000FF, "Beard");
    }

    else if(newkeys & KEY_SECONDARY_ATTACK) {
        fremove("export.txt");
        new File:expFile = fopen("export.txt");

        for(new i; i < 312; i++) {
            fwrite(expFile, sprintf("%i|%i\r\n", skinHasHat[i], skinHasBeard[i]));
        }

        fclose(expFile);

        SendClientMessage(playerid, -1, "Exported");
    }

    return 1;
}
@Crayder Crayder added the todo label Sep 11, 2016
@Crayder
Copy link
Owner Author

Crayder commented Sep 11, 2016

The same concept code could be used for the other ones too, like the breast sizes. But instead of boolean setting it would be cycling keys, yes for up a size and no for down a size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant