Posts: 96
Threads: 23
Joined: Aug 2012
Reputation:
0
24.06.2015, 03:22
(
Последний раз редактировалось sheNdjze; 24.06.2015 в 04:22.
)
When you connect to the server, at skin selection is there a way to bring the player to the skin he selected last time he changed his kin, like i choose skin with id 230 and when i relog when i got to select my skin it give me 230 without staying to find it, and it should do the same when i chose another skin and i spawn with it.
(I saw this on GTA:T server, search on ****** for it and if you want to give a look join GTA:T server spawn yourself and relog, if MySQL needed for do this script its ok, my gamemode already running MySQL with BlueG's script)
Sorry for my bad english, and move the theard if i wrong forum...
Little video about what i want:
[ame]http://www.youtube.com/watch?v=nUrMvtXULho[/ame]
Posts: 561
Threads: 27
Joined: Sep 2012
For save the skin, you should put this code under OnPlayerDisconnect :
PHP код:
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Leaders\\%s.ini", pname);//leader the name of your folder in scriptfiles
if(!dini_Exists(file))
dini_Create(file);
dini_IntSet(file, "skin", GetPlayerSkin(playerid));
For Loading your skin, put this code under OnPlayerSpawn :
PHP код:
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Leaders\\%s.ini", pname);
if(dini_Exists(file))
{
SetTimerEx("SpawnSave", 100, false, "d", playerid);
}
At the end :
PHP код:
forward SpawnSave(playerid);
public SpawnSave(playerid)
{
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "\\Leaders\\%s.ini", pname);
SetPlayerSkin(playerid, dini_Int(file, "skin"));
return 1;
}
And don't forget to include dini at the top of your scripts :
Hope it helps,
KillerDVX,
Posts: 96
Threads: 23
Joined: Aug 2012
Reputation:
0
Your script is good, but not what i requested :\ this script save the skin and dont let me change it again if i want to spawn with another, i want something that on the skin selection brings me to the last skin i used and here i choose if to spawn with it or not...
Posts: 561
Threads: 27
Joined: Sep 2012
Use mSelection, include made by d0.
It allows you to show models in textdraws.
You just have to add models on a list in your scriptfiles folder like {myskin.txt}.
KillerDVX,
Posts: 96
Threads: 23
Joined: Aug 2012
Reputation:
0
Same thing man :\ i think you didn't understeand what i need, but its ok, thank you anyway maybe this will help other people, but i will explain once again what i need, you choose at skin id 230 and you spawn, when you relog or join the server after some hours/days/years/wathever, it should not spawn you with the skin you spawned last time but bring you to the skin you selected last time and here you should be able to choose id230 or press on >> with mouse and select another one, i want something like this
Posts: 96
Threads: 23
Joined: Aug 2012
Reputation:
0
Here is a video about what i want:
[ame]http://www.youtube.com/watch?v=nUrMvtXULho[/ame]
Posts: 561
Threads: 27
Joined: Sep 2012
Quote:
Originally Posted by KillerDVX
Use mSelection, include made by d0.
It allows you to show models in textdraws.
You just have to add models on a list in your scriptfiles folder like {myskin.txt}.
KillerDVX,
|
EDIT: The link : https://sampforum.blast.hk/showthread.php?tid=407045
Posts: 96
Threads: 23
Joined: Aug 2012
Reputation:
0
A good idea, but i want it like the one in the server bro not with a clickable skin or w/e it is
Posts: 96
Threads: 23
Joined: Aug 2012
Reputation:
0
Sithis i dont need your opinion for make the script, so please go away.