Samp duplicate preview models
#1

When i use /setskin my preview model of skin duplicate,when i change skin old skin not destroy
duplicate with new,how to fix
use some timer or timer for destroy textdraw every time ?


Код:
dole7[playerid] = CreatePlayerTextDraw(playerid, 443.199615, 375.573730, "New Textdraw");
	PlayerTextDrawLetterSize(playerid, dole7[playerid], 0.449999, 1.600000);
	PlayerTextDrawTextSize(playerid, dole7[playerid], 57.599990, 41.813346);
	PlayerTextDrawAlignment(playerid, dole7[playerid], 1);
	PlayerTextDrawColor(playerid, dole7[playerid], -1);
	PlayerTextDrawUseBox(playerid, dole7[playerid], true);
	PlayerTextDrawBoxColor(playerid, dole7[playerid], 0);
	PlayerTextDrawSetShadow(playerid, dole7[playerid], 0);
	PlayerTextDrawSetOutline(playerid,dole7[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, dole7[playerid], 0x00000000);
	PlayerTextDrawFont(playerid, dole7[playerid], 5);
	PlayerTextDrawSetProportional(playerid, dole7[playerid], 1);
	PlayerTextDrawSetPreviewModel(playerid, dole7[playerid], GetPlayerSkin(playerid)); { SetTimer("Refreshskin", 1000, 0 ); }
	PlayerTextDrawSetPreviewRot(playerid, dole7[playerid], 0.000000, 0.000000, 0.000000, 1.000000);
	PlayerTextDrawShow(playerid, dole7[playerid]);


update here is the command 
CMD:setskin(playerid, params[])
{
	if(IsPlayerConnected(playerid))
	{
	    if(JustReported[playerid] == 1)
		{
			SCM(playerid, COLOR_GREY, "** Moras sacekati par minuta da bi opet poslao pitanje adminima! ");
			return 1;
		}
		new sendername[MAX_PLAYER_NAME],giveplayerid,level,giveplayer[MAX_PLAYER_NAME],string[128];
		GetPlayerName(playerid, sendername, sizeof(sendername));
  		if(sscanf(params,"ud",giveplayerid,level)) return SCM(playerid, COLOR_GRAD2, "Koriscenje: /setskin [ID Igraca/Deo Imena] [skin id]");
		if(level > 299 || level < 1) { SCM(playerid, COLOR_GREY, "Pogresan ID!"); return 1; }
		if(level == 74) { SCM(playerid, COLOR_GREY, "Ovaj skin ne mozete nikome dati jer je zabranjen.."); return 1; }
		if(PlayerInfo[playerid][Admin] >= 5)
  	{
		if(giveplayerid != INVALID_PLAYER_ID)
			{
				GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
				PlayerInfo[giveplayerid][pChar] = level;
				format(string, sizeof(string), "** Administrator %s Has Changed Your Skin.", sendername);
				SCM(giveplayerid, TEAM_GROVE_COLOR, string);
				format(string, sizeof(string), "** You Granted %s skin number %d.", giveplayer,level);
				SCM(playerid, COLOR_ORANGE, string);
				format(string, sizeof(string), "[ADMIN]: %s Gave The Skin [%d] to %s (%d).",sendername, level, giveplayer, giveplayerid);
				ABroadCast(COLOR_LIGHTRED,string, 5);
				SetPlayerSkin(giveplayerid, PlayerInfo[giveplayerid][pChar]);
				dole7[playerid] = CreatePlayerTextDraw(playerid, 443.199615, 375.573730, "New Textdraw");
				PlayerTextDrawLetterSize(playerid, dole7[playerid], 0.449999, 1.600000);
				PlayerTextDrawTextSize(playerid, dole7[playerid], 57.599990, 41.813346);
				PlayerTextDrawAlignment(playerid, dole7[playerid], 1);
				PlayerTextDrawColor(playerid, dole7[playerid], -1);
				PlayerTextDrawUseBox(playerid, dole7[playerid], true);
				PlayerTextDrawBoxColor(playerid, dole7[playerid], 0);
				PlayerTextDrawSetShadow(playerid, dole7[playerid], 0);
				PlayerTextDrawSetOutline(playerid,dole7[playerid], 1);
				PlayerTextDrawBackgroundColor(playerid, dole7[playerid], 0x00000000);
				PlayerTextDrawFont(playerid, dole7[playerid], 5);
				PlayerTextDrawSetProportional(playerid, dole7[playerid], 1);
				PlayerTextDrawHide(playerid, dole7[playerid], GetPlayerSkin(playerid)); { SetTimer("Refreshskin", 1000, 0 ); }
				PlayerTextDrawSetPreviewRot(playerid, dole7[playerid], 0.000000, 0.000000, 0.000000, 1.000000);
				PlayerTextDrawShow(playerid, dole7[playerid]);
				SetTimerEx("ReportReset", 30000, false, "i", playerid);
				JustReported[playerid] = 1;
				new y, m, d;
				new h,mi,s;
				getdate(y,m,d);
				gettime(h,mi,s);
				format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Gave The Skin [%d] to %s",d,m,y,h,mi,s,sendername,level,giveplayer);
				GiveLog(string);
			}
		}
		else
		{
			SCM(playerid, COLOR_GRAD1, "   Niste ovlasceni da koristite ovu komandu!");
		}
	}
	return 1;
}
Reply
#2

Where's your command script?
Reply
#3

CMDetskin(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(JustReported[playerid] == 1)
{
SCM(playerid, COLOR_GREY, "** Moras sacekati par minuta da bi opet poslao pitanje adminima! ");
return 1;
}
new sendername[MAX_PLAYER_NAME],giveplayerid,level,giveplayer[MAX_PLAYER_NAME],string[128];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(sscanf(params,"ud",giveplayerid,level)) return SCM(playerid, COLOR_GRAD2, "Koriscenje: /setskin [ID Igraca/Deo Imena] [skin id]");
if(level > 299 || level < 1) { SCM(playerid, COLOR_GREY, "Pogresan ID!"); return 1; }
if(level == 74) { SCM(playerid, COLOR_GREY, "Ovaj skin ne mozete nikome dati jer je zabranjen.."); return 1; }
if(PlayerInfo[playerid][Admin] >= 5)
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
PlayerInfo[giveplayerid][pChar] = level;
format(string, sizeof(string), "** Administrator %s Has Changed Your Skin.", sendername);
SCM(giveplayerid, TEAM_GROVE_COLOR, string);
format(string, sizeof(string), "** You Granted %s skin number %d.", giveplayer,level);
SCM(playerid, COLOR_ORANGE, string);
format(string, sizeof(string), "[ADMIN]: %s Gave The Skin [%d] to %s (%d).",sendername, level, giveplayer, giveplayerid);
ABroadCast(COLOR_LIGHTRED,string, 5);
SetPlayerSkin(giveplayerid, PlayerInfo[giveplayerid][pChar]);
dole7[playerid] = CreatePlayerTextDraw(playerid, 443.199615, 375.573730, "New Textdraw");
PlayerTextDrawLetterSize(playerid, dole7[playerid], 0.449999, 1.600000);
PlayerTextDrawTextSize(playerid, dole7[playerid], 57.599990, 41.813346);
PlayerTextDrawAlignment(playerid, dole7[playerid], 1);
PlayerTextDrawColor(playerid, dole7[playerid], -1);
PlayerTextDrawUseBox(playerid, dole7[playerid], true);
PlayerTextDrawBoxColor(playerid, dole7[playerid], 0);
PlayerTextDrawSetShadow(playerid, dole7[playerid], 0);
PlayerTextDrawSetOutline(playerid,dole7[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, dole7[playerid], 0x00000000);
PlayerTextDrawFont(playerid, dole7[playerid], 5);
PlayerTextDrawSetProportional(playerid, dole7[playerid], 1);
PlayerTextDrawHide(playerid, dole7[playerid], GetPlayerSkin(playerid)); { SetTimer("Refreshskin", 1000, 0 ); }
PlayerTextDrawSetPreviewRot(playerid, dole7[playerid], 0.000000, 0.000000, 0.000000, 1.000000);
PlayerTextDrawShow(playerid, dole7[playerid]);
SetTimerEx("ReportReset", 30000, false, "i", playerid);
JustReported[playerid] = 1;
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Gave The Skin [%d] to %s",d,m,y,h,mi,s,sendername,level,giveplayer);
GiveLog(string);
}
}
else
{
SCM(playerid, COLOR_GRAD1, " Niste ovlasceni da koristite ovu komandu!");
}
}
return 1;
}
Reply
#4

use [PA WN]codehere[/PAWN]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)