[HELP] with skin saving! - 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] with skin saving! (
/showthread.php?tid=356063)
[HELP] with skin saving! -
anito - 02.07.2012
Hi guys. I'm having problem with skin saving. What I need to add to make my skin saving workable. I would like to have skin saving which on exit save skin ID and next time i open my server, it just show my skin (last time used one) on skin selection. Just show skin not to spawn with that skin! Thanks in advance.
Sincerely,
anito
Respuesta: [HELP] with skin saving! -
[DOG]irinel1996 - 02.07.2012
You can make that with dini, I think in this case it's the fastest way. If you don't know how to use it, just ask me here.
Best regards!
Re: Respuesta: [HELP] with skin saving! -
anito - 02.07.2012
Quote:
Originally Posted by irinel1996
You can make that with dini, I think in this case it's the fastest way. If you don't know how to use it, just ask me here.
Best regards!
|
Ok, sir. I don't know how to do it! Can you please help me? REP+
Respuesta: [HELP] with skin saving! -
[DOG]irinel1996 - 02.07.2012
First you have to
download it, and put the file in
pawno/include. OK, time to save the skins. Create a folder in
scriptfiles called
Skins.
pawn Код:
//You have to include it:
#include <dini>
//You can put this line under #include <a_samp>
new bool:FirstSpawn[MAX_PLAYERS char] = false;
//---
public OnPlayerConnect(playerid)
{
FirstSpawn[playerid] = true;
new name[MAX_PLAYER_NAME], file_path[50];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(file_path,50,"/Skins/%s.ini",name);
if(!dini_exists(file_path))
{
dini_Create(file_path);
dini_IntSet(file_path,"Skin",0);
}
return 1;
}
public OnPlayerDisconnect(playerid)
{
new name[MAX_PLAYER_NAME], file_path[50];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(file_path,50,"/Skins/%s.ini",name);
dini_IntSet(file_path,"Skin",GetPlayerSkin(playerid));
return 1;
}
public OnPlayerSpawn(playerid)
{
if(FirstSpawn[playerid] == true)
{
new name[MAX_PLAYER_NAME], file_path[50];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
format(file_path,50,"/Skins/%s.ini",name);
SetPlayerSkin(playerid, dini_Get(file_path,"Skin"));
SendClientMessage(playerid,-1,"Skin loaded");
FirstSpawn[playerid] = false;
}
return 1;
}
It should work, I didn't test it.
Re: Respuesta: [HELP] with skin saving! -
anito - 02.07.2012
Quote:
Originally Posted by irinel1996
First you have to download it, and put the file in pawno/include. OK, time to save the skins. Create a folder in scriptfiles called Skins.
pawn Код:
//You have to include it: #include <dini> //You can put this line under #include <a_samp>
new bool:FirstSpawn[MAX_PLAYERS char] = false;
//--- public OnPlayerConnect(playerid) { FirstSpawn[playerid] = true; new name[MAX_PLAYER_NAME], file_path[50]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); format(file_path,50,"/Skins/%s.ini",name); if(!dini_exists(file_path)) { dini_Create(file_path); dini_IntSet(file_path,"Skin",0); } return 1; }
public OnPlayerDisconnect(playerid) { new name[MAX_PLAYER_NAME], file_path[50]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); format(file_path,50,"/Skins/%s.ini",name); dini_IntSet(file_path,"Skin",GetPlayerSkin(playerid)); return 1; }
public OnPlayerSpawn(playerid) { if(FirstSpawn[playerid] == true) { new name[MAX_PLAYER_NAME], file_path[50]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); format(file_path,50,"/Skins/%s.ini",name); SetPlayerSkin(playerid, dini_Get(file_path,"Skin")); SendClientMessage(playerid,-1,"Skin loaded"); FirstSpawn[playerid] = false; } return 1; }
It should work, I didn't test it.
|
Here is the thing. I asked one user for help before this thread and he sent me skin code he made with ysi so it works. I don't need this code sir but i gave you rep+! Thank you!
Respuesta: [HELP] with skin saving! -
[DOG]irinel1996 - 02.07.2012
OK, you're welcome.
Best regards!