SA-MP Forums Archive
save skin - 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: save skin (/showthread.php?tid=147243)



save skin - gupey1984 - 11.05.2010

how i get it to save skin when i get back on?
Код:
if(strcmp(cmd, "/changeskin", true) == 0)
	{
		if(PlayerToPoint(15.0, playerid, 204.289978,-160.133514,1000.523437))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GREY, "USAGE: /changeskin [skin]");
				return 1;
			}
			new skinid = strval(tmp);
			if (skinid<0 || skinid > 299)
	  	{
	  		SendClientMessage(playerid, COLOR_GREY, "Invalid skin ID, must be between 0 and 299");
				return 1;
	  	}
			PlayerInfo[giveplayerid][pModel] = skinid;
			OnPlayerUpdate(giveplayerid);
			SetPlayerSkin(giveplayerid, skinid);
			return 1;
		}
		else
		{
		  SendClientMessage(playerid, COLOR_GREY, "  You are not at Binco !");
		}
	  return 1;
	}



Re: save skin - luigifan9 - 11.05.2010

Quote:
Originally Posted by gupey1984
how i get it to save skin when i get back on?
Код:
if(strcmp(cmd, "/changeskin", true) == 0)
	{
		if(PlayerToPoint(15.0, playerid, 204.289978,-160.133514,1000.523437))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GREY, "USAGE: /changeskin [skin]");
				return 1;
			}
			new skinid = strval(tmp);
			if (skinid<0 || skinid > 299)
	  	{
	  		SendClientMessage(playerid, COLOR_GREY, "Invalid skin ID, must be between 0 and 299");
				return 1;
	  	}
			PlayerInfo[giveplayerid][pModel] = skinid;
			OnPlayerUpdate(giveplayerid);
			SetPlayerSkin(giveplayerid, skinid);
			return 1;
		}
		else
		{
		  SendClientMessage(playerid, COLOR_GREY, " You are not at Binco !");
		}
	  return 1;
	}[
Learn Dini



Re: save skin - coole210 - 11.05.2010

Код:
if(strcmp(cmd, "/changeskin", true) == 0)
	{
		if(PlayerToPoint(15.0, playerid, 204.289978,-160.133514,1000.523437))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GREY, "USAGE: /changeskin [skin]");
				return 1;
			}
			new skinid = strval(tmp);
			if (skinid<0 || skinid > 299)
	  	{
	  		SendClientMessage(playerid, COLOR_GREY, "Invalid skin ID, must be between 0 and 299");
				return 1;
	  	}
			PlayerInfo[giveplayerid][pModel] = skinid;
			OnPlayerUpdate(giveplayerid);
			SetPlayerSkin(giveplayerid, skinid);
			new omgstring[128];
			new omgstring2[128];
			new omgname[MAX_PLAYER_NAME];
			GetPlayerName(playerid,omgname,sizeof(omgname));
			format(omgstring,sizeof(omgstring),"Skins/%s.ini",omgname);//make sure you make a Skins folder
			format(omgstring2,sizeof(omgstring2),"SkinID=%d\r\n",skinid);
			new File:omgfile=fopen(omgstring,io_write);
			fwrite(omgfile,omgstring2);
			fclose(omgfile);
			return 1;
		}
		else
		{
		  SendClientMessage(playerid, COLOR_GREY, "  You are not at Binco !");
		}
	  return 1;
	}



Re: save skin - gupey1984 - 11.05.2010

how i make a Skins folder?


Re: save skin - coole210 - 11.05.2010

omg just right click and go to new > folder and name it "Skins" (put it in scriptfiles)


Re: save skin - gupey1984 - 11.05.2010

thats all?


Re: save skin - coole210 - 11.05.2010

Yeah..


Re: save skin - gupey1984 - 11.05.2010

it works thanks very much i been trying get that for days but thanks


Re: save skin - oded050 - 08.08.2010

can i ask you something?
if i want that skin be saved all the time without command, what i need to do?

im try to take this code:
Код:
			new omgstring[128];
			new omgstring2[128];
			new skinid;
			new omgname[MAX_PLAYER_NAME];
			GetPlayerName(playerid,omgname,sizeof(omgname));
			format(omgstring,sizeof(omgstring),"Skins/%s.ini",omgname);//make sure you make a Skins folder
			format(omgstring2,sizeof(omgstring2),"SkinID=%d\r\n",skinid);
			new File:omgfile=fopen(omgstring,io_write);
			fwrite(omgfile,omgstring2);
			fclose(omgfile);
and its not working in the server..
in "scriptfiles\Skins\mynick.ini" write: SkinID=0
and.. in my server i press "F4" and its give me to change my class..
can you help me? plz!


Re: save skin - mickos - 06.05.2012

easy hahaha