Bring player on last skin he selected
#1

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]
Reply
#2

For save the skin, you should put this code under OnPlayerDisconnect :

PHP код:
new file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playeridpnamesizeof(pname));
format(filesizeof(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(playeridpnamesizeof(pname));
format(filesizeof(file), "\\Leaders\\%s.ini"pname);
if(
dini_Exists(file))
{
SetTimerEx("SpawnSave"100false"d"playerid);

At the end :

PHP код:
forward SpawnSave(playerid);
public 
SpawnSave(playerid)
{
new 
file[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playeridpnamesizeof(pname));
format(filesizeof(file), "\\Leaders\\%s.ini"pname);
SetPlayerSkin(playeriddini_Int(file"skin"));
return 
1;

And don't forget to include dini at the top of your scripts :

PHP код:
#include <dini> 
Hope it helps,

KillerDVX,
Reply
#3

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...
Reply
#4

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,

Reply
#5

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
Reply
#6

Here is a video about what i want:

[ame]http://www.youtube.com/watch?v=nUrMvtXULho[/ame]
Reply
#7

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
Reply
#8

A good idea, but i want it like the one in the server bro not with a clickable skin or w/e it is
Reply
#9

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,

Seriously, use the default font and colors. This light blue italic shit is unreadable on a mobile device.
Reply
#10

Sithis i dont need your opinion for make the script, so please go away.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)