help , save skin in mysql
#1

can someone help me how to save Skin in mysql and thnx
(sorry fo my bad english)
best regards
Reply
#2

anyone?
Reply
#3

Here, I gave you saveskin, useskin and deleteskin
pawn Код:
CMD:saveskin( playerid, params[ ] )
{
    new SkinID;

    if ( sscanf( params, "i", SkinID ) )
        return SendClientMessage( playerid, COLOR_ULTRARED, "USAGE: {33CCFF}/saveskin [SkinID]" );

    if ( SkinID < 0 || SkinID > 300 )
        return SendError( playerid, "Only between 0 and 300 skins" );

    PlayerInfo[ playerid ][ FavSkin ] = SkinID;
    PlayerInfo[ playerid ][ UseSkin ] = ( 1 );

    FormatMSG( playerid, COLOR_GREEN, "SUCCES: {FFFF00}You have successfully saved this skin (ID: %d)", SkinID );
    SendClientMessage( playerid, COLOR_YELLOW, "Type: {00FF00}/useskin {FFFF00}to use this skin when you spawn or {00FF00}/dontuseskin {FFFF00}to stop using skin" );
    return ( 1 );
}

CMD:useskin( playerid, params[ ] )
{
    if ( PlayerInfo[ playerid ][ UseSkin ] != 1 )
        return SendError( playerid, "You need to /saveskin before use this command." );

    SetPlayerSkin( playerid, PlayerInfo[ playerid ][ FavSkin ] );
    return ( 1 );
}

CMD:deleteskin( playerid, params[ ] )
{
    SetPlayerSkin( playerid, 217 );
    PlayerInfo[ playerid ][ UseSkin ] = 0;
    FormatMSG( playerid, COLOR_GREEN, "SUCCES: {FFFF00}You have successfully removed you saved skin: %d", PlayerInfo[ playerid ][ FavSkin ] );
    return ( 1 );
}
Reply
#4

Quote:
Originally Posted by ShadyX
Посмотреть сообщение
Here, I gave you saveskin, useskin and deleteskin
pawn Код:
CMD:saveskin( playerid, params[ ] )
{
    new SkinID;

    if ( sscanf( params, "i", SkinID ) )
        return SendClientMessage( playerid, COLOR_ULTRARED, "USAGE: {33CCFF}/saveskin [SkinID]" );

    if ( SkinID < 0 || SkinID > 300 )
        return SendError( playerid, "Only between 0 and 300 skins" );

    PlayerInfo[ playerid ][ FavSkin ] = SkinID;
    PlayerInfo[ playerid ][ UseSkin ] = ( 1 );

    FormatMSG( playerid, COLOR_GREEN, "SUCCES: {FFFF00}You have successfully saved this skin (ID: %d)", SkinID );
    SendClientMessage( playerid, COLOR_YELLOW, "Type: {00FF00}/useskin {FFFF00}to use this skin when you spawn or {00FF00}/dontuseskin {FFFF00}to stop using skin" );
    return ( 1 );
}

CMD:useskin( playerid, params[ ] )
{
    if ( PlayerInfo[ playerid ][ UseSkin ] != 1 )
        return SendError( playerid, "You need to /saveskin before use this command." );

    SetPlayerSkin( playerid, PlayerInfo[ playerid ][ FavSkin ] );
    return ( 1 );
}

CMD:deleteskin( playerid, params[ ] )
{
    SetPlayerSkin( playerid, 217 );
    PlayerInfo[ playerid ][ UseSkin ] = 0;
    FormatMSG( playerid, COLOR_GREEN, "SUCCES: {FFFF00}You have successfully removed you saved skin: %d", PlayerInfo[ playerid ][ FavSkin ] );
    return ( 1 );
}
thnx for the help but i don't mean the command i mean how to save it in database using mysql can you help me or anyone? and thnx

(sorry for my bad english)
Reply
#5

You can't save skins in Database. It's saved with Player Account.
Reply
#6

Hi,

You will need to add an enum to save player variables and under it place SavedSkin, and make a cmd or whatever you want to set the skin that the player choose to SavedSkin variable, for example a cmd like saveskin id which places places the skin in the variable
pInfo[playerid][SavedSkin] = skinid;
skinid should be in a new under the cmd and you should use it in sscanf, also onplayerspawn set the player skin to the variable we defined in enum
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)