save skin
#1

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;
	}
Reply
#2

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

Код:
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;
	}
Reply
#4

how i make a Skins folder?
Reply
#5

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

thats all?
Reply
#7

Yeah..
Reply
#8

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

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!
Reply
#10

easy hahaha
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)