valesti Posted September 4, 2017 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 44 Reputation: 5 Joined: 10/07/14 Last Seen: April 20 Share Posted September 4, 2017 Anyone know how do that? I wanna to use in a system. Example: PS: If player use the color 211, when the event ends, return the palette to 211. Thanks all! Quote Link to comment Share on other sites More sharing options...
2 sader1992 Posted September 4, 2017 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: 3 hours ago Share Posted September 4, 2017 (edited) .@charid = getcharid(0); query_sql( "SELECT `clothes_color` FROM `char` WHERE `char_id` = '"+.@charid+"'",.@clothesc ); now .@clothesc = the color you can save it to char variables or else where and call it when you want it if you put the script here it would be easier for us to help Edited September 4, 2017 by sader1992 1 1 Quote Link to comment Share on other sites More sharing options...
0 valesti Posted September 4, 2017 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 44 Reputation: 5 Joined: 10/07/14 Last Seen: April 20 Author Share Posted September 4, 2017 (edited) The only problem is: if the player changes the color, the variable dont update with the new number. Just after login another time. Example: Can i update the variable in game? Thanks for your help! Edited September 4, 2017 by valesti Quote Link to comment Share on other sites More sharing options...
0 sader1992 Posted September 4, 2017 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: 3 hours ago Share Posted September 4, 2017 (edited) the sql update when you login or when you use the script you just need to make sure that the line called everytime you want to save new value so i see here in the photo you are using another style and when you back to your style you back to the old color try that>> when you talk to the npc he will save the color value first then he will ask you to change your style ? ok change your style and when you get back to your old style make the npc restore your color after he gives you your old style back if you put the script it would be easier for us Edited September 4, 2017 by sader1992 Quote Link to comment Share on other sites More sharing options...
0 valesti Posted September 4, 2017 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 44 Reputation: 5 Joined: 10/07/14 Last Seen: April 20 Author Share Posted September 4, 2017 function script SaveClothes { // Save Clothes Color .@charid = getcharid(0); query_sql( "SELECT `clothes_color` FROM `char` WHERE `char_id` = '"+.@charid+"'",.@clothesc ); setlook 7,0; setlook LOOK_BODY2,1; } function script PutClothes { // Put Clothes .@charid = getcharid(0); query_sql( "SELECT `clothes_color` FROM `char` WHERE `char_id` = '"+.@charid+"'",.@clothesc ); setlook LOOK_BODY2,0; setlook LOOK_CLOTHES_COLOR,.@clothesc; } @sader1992 The function is called when the player equips/removes the item. SaveClothes = Player equips the item. PutClothes = Player removes the item. Here the stylist: https://pastebin.com/f2iqCcR6 Quote Link to comment Share on other sites More sharing options...
0 sader1992 Posted September 4, 2017 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: 3 hours ago Share Posted September 4, 2017 // Save Clothes Color == the player equip the item ? // Put Clothes == unequip ? Quote Link to comment Share on other sites More sharing options...
0 valesti Posted September 4, 2017 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 44 Reputation: 5 Joined: 10/07/14 Last Seen: April 20 Author Share Posted September 4, 2017 (edited) 3 minutes ago, sader1992 said: // Save Clothes Color == the player equip the item ? // Put Clothes == unequip ? Yes! { callfunc "SaveClothes"; },{ callfunc "PutClothes"; } And i finded another problem... If the player left the game using the equip, when he login the color is 0 again. Edited September 4, 2017 by valesti Quote Link to comment Share on other sites More sharing options...
0 sader1992 Posted September 4, 2017 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: 3 hours ago Share Posted September 4, 2017 (edited) function script SaveClothes { // Save Clothes Color .@charid = getcharid(0); query_sql( "SELECT `clothes_color` FROM `char` WHERE `char_id` = '"+.@charid+"'",clothesc ); setlook 7,0; setlook LOOK_BODY2,1; } function script PutClothes { // Put Clothes setlook LOOK_BODY2,0; setlook LOOK_CLOTHES_COLOR,clothesc; } Edited September 4, 2017 by sader1992 Quote Link to comment Share on other sites More sharing options...
0 valesti Posted September 4, 2017 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 44 Reputation: 5 Joined: 10/07/14 Last Seen: April 20 Author Share Posted September 4, 2017 (edited) If i remove the query_sql in "PutClothes", the color always be 0. But thanks, man. You're helping me a lot. Edited September 4, 2017 by valesti Quote Link to comment Share on other sites More sharing options...
0 sader1992 Posted September 5, 2017 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: 3 hours ago Share Posted September 5, 2017 query_sql( "SELECT `clothes_color` FROM `char` WHERE `char_id` = '"+.@charid+"'",clothesc ); this line save the value of the color in a char variable (clothesc) this mean that if the color value 5 clothesc will also be 5 and now you can call clothesc without sql cuz it's a variable by just typing it so if after you call the func SaveClothes and the cloth color was 23 if you but npc say mes clothesc; the npc will say 23 and in the unequip you are setting the color to clothesc value so it will be 23 if you call the sql line in equip again in unequip that what will happen you are setting clothesc to the color value (let's say 23) when equip then the style change and the color for the new style will be 0 and when unequip the sql will be called again and will save clothesc color as 0 from the new style and remove the old value from it and you will end up with the color 0 after unequip Quote Link to comment Share on other sites More sharing options...
Question
valesti
Anyone know how do that? I wanna to use in a system.
Example:
PS: If player use the color 211, when the event ends, return the palette to 211.
Thanks all!
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.