[Ajuda] resetar skin para a original do player depois de /batercartao
#1

Acrescentei umas linhas no comando /batercartao na policia para por skins aleatуrias da policia.
ficou assim:
Код:
if(strcmp(cmd, "/batercartao", true) == 0)
	{
		if(PlayerInfo[playerid][pJailed] != 0)
    	{
	   		SendClientMessage(playerid,COLOR_YELLOW," Vocк nгo pode batercartao na cadeia!");
			return true;
	    }
	    if(IsPlayerConnected(playerid))
	    {
			GetPlayerName(playerid, sendername, sizeof(sendername));
			if(IsACop(playerid))
			{
            	if(PlayerToPoint(2,playerid,1530.3060,-1702.4915,6.2252) || PlayerToPoint(2,playerid,326.6374,307.1123,999.1484) || PlayerToPoint(2,playerid,302.7936,-1529.9443,24.9219) || PlayerToPoint(2,playerid,240.6516,112.8062,1003.2188) || PlayerToPoint(2,playerid,255.1123,77.4241,1003.6406) || PlayerToPoint(2,playerid,229.8059,164.7830,1003.0234)
			 	|| PlayerToPoint(2,playerid,-1521.1884,462.9987,7.1875) || PlayerToPoint(2,playerid,712.7550,-554.5677,-3.5950) || PlayerToPoint(2,playerid,-1588.4751,732.4855,-4.9063))
				{
					if(OnDuty[playerid]==0)
			        {
						new rand = random(sizeof (SkinsPoliciaDP));
						SetPlayerSkin(playerid, SkinsPoliciaDP[rand]);
						format(string, sizeof(string), "Oficial %s esta Fardado.", sendername);
						SendClientMessageToAll(COLOR_DBLUE,string);
	    				format(string, sizeof(string), "* O Policial %s Pegou seus equipamentos", sendername);
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						//SetPlayerAttachedObject(playerid,3,18637,13,0.35,0.0,0.0,0.0,0.0,180.0);
                        VidaDoCara[playerid] = 2; AXITERCOLETE[playerid] = 3;
                        GivePlayerWeaponBPH(playerid, 24, 150);
                        GivePlayerWeaponBPH(playerid, 25, 250);
						SetPlayerArmour(playerid, 100);
						SetPlayerHealth(playerid, 100);
						OnDuty[playerid] = 1;
						EmpregoDuty[playerid] = 2;
						Copsronda += 1;
					}
					else if(OnDuty[playerid]==1)
					{
						format(string, sizeof(string), "Oficial %s esta de Folga.", sendername);
						SendClientMessageToAll(COLOR_DBLUE,string);
	    				format(string, sizeof(string), "* O Policial %s guardou seus equipamentos", sendername);
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						//RemovePlayerAttachedObject(playerid,3);
						OnDuty[playerid] = 0;
						EmpregoDuty[playerid] = 0;
						Copsronda -= 1;
					}
				}
			}
		}
		return true;
	}


Ate aqui esta tudo bem mas quando digito /batercartao denovo queria que a skin se resetasse para a que o player tinha antes de digitar a 1 vez /batercartao. Alguem pode ajudar
Reply
#2

Use Pvars:

pawn Код:
// Quando bater cartгo pela primeira vez:

SetPVarInt(playerid, "Skin_O", GetPlayerSkin(playerid));

// Para voltar a skin original

SetPlayerSkin(playerid, GetPVarInt(playerid, "Skin_O"));
DeletePVar(playerid, "Skin_O");
Reply
#3

Obrigadгo, sem erros nenhuns!!!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)