help , save skin in mysql - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help , save skin in mysql (
/showthread.php?tid=540673)
help , save skin in mysql -
simo0000 - 06.10.2014
can someone help me how to save Skin in mysql and thnx
(sorry fo my bad english)
best regards
Re : help , save skin in mysql -
simo0000 - 06.10.2014
anyone?
Re: help , save skin in mysql -
Shady - 06.10.2014
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 );
}
Re : Re: help , save skin in mysql -
simo0000 - 06.10.2014
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)
Re: help , save skin in mysql -
Shady - 06.10.2014
You can't save skins in Database. It's saved with Player Account.
Re: help , save skin in mysql -
Ghazal - 06.10.2014
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