SA-MP Forums Archive
[Pedido] comando de skin por id - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Pedido] comando de skin por id (/showthread.php?tid=492246)



comando de skin por id - xXCallXX - 02.02.2014

tipo digita /skin id dar skin ajuda ae


Re: comando de skin por id - FallweN - 02.02.2014

pawn Код:
CMD:skin(playerid, params[]) {
    new Skin;
   
    if(sscanf(params, "i", Skin))
        return SendClientMessage(playerid, -1, "/Skin ID");
       
    SetPlayerSkin(playerid, Skin);
    return true;
}
mano melhore seu portuguкs porque ta feia a coisa.


Re: comando de skin por id - kevinho.007 - 02.02.2014

Код:
CMD:mudarskin(playerid, params[]) 
{
    new idskin;
    if(sscanf(params, "u", idskin))  return SendClientMessage(playerid, -1, "Digite: /mudarskin [id da skin]");
    SendClientMessage(playerid,-1,"Vocк mudou sua roupa.");
    SetPlayerSkin(playerid, idskin);
    return 1;
}



Re: comando de skin por id - xXCallXX - 03.02.2014



deu merda


Re: comando de skin por id - kevinho.007 - 03.02.2014

Quote:
Originally Posted by xXCallXX
Посмотреть сообщение


deu merda
Код:
if(strcmp(cmd, "/mudarskin", true) == 0)
{
     	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp)) return SendClientMessage(playerid, -1, "Digite: /mudarskin [skin id]");
	new level;
	tmp = strtok(cmdtext, idx);
	level = strval(tmp);
	if(level > 299 || level < 1) return SendClientMessage(playerid, -1, "id desconhecido!"); 
	SetPlayerSkin(playerid, level);
	return 1;
}



Re: comando de skin por id - rjjj - 03.02.2014

Adicione isto ao seu OnPlayerCommandText :


pawn Код:
if(!strfind(cmdtext, "/skin", true))
    {
        if(cmdtext[5] == '\0' || cmdtext[5] == ' ')
        {
            if(cmdtext[5] != ' ' || cmdtext[6] == '\0')   return SendClientMessage(playerid, 0xFFFFFFAA, "Digite: /skin [id da skin]");
            for(new x = 6; cmdtext[x] != EOS; x++)
            {
                if(cmdtext[x] != ' ')
                {
                    new STR[4];
                    strcat(STR, cmdtext[x]);
                    for(new y = 0; STR[y] != EOS; y++)
                    {
                        if(STR[y] < '0' || STR[y] > '9')
                        {
                            SendClientMessage(playerid, 0xFFFFFFAA, "Digite: /skin [id da skin]");
                            return true;
                        }
                    }
                    new SkinID = strval(cmdtext[x]);
                    if(SkinID > 299)  return  SendClientMessage(playerid, 0xFFFFFFAA, "IDs de skins sгo vбlidos atй 299 !");
                    SetPlayerSkin(playerid, SkinID);
                    SendClientMessage(playerid, 0x33CCFFAA, "Sua skin foi definida com sucesso !");
                    return true;
                }
            }
            SendClientMessage(playerid, 0xFFFFFFAA, "Digite: /skin [id da skin]");
            return true;
        }
    }


Espero ter ajudado .


Re: comando de skin por id - giovanehen - 03.02.2014

PHP код:
COMMAND:setskin(playeridparams[])
{
    
// Setup local variables
    
new Msg[128], Skin;
    
// Send the command to all admins so they can see it
    
SendAdminText(playerid"/setskin"params);
    
// Check if the player has logged in
    
if (APlayerData[playerid][LoggedIn] == true)
    {
        
// Check if the player's admin-level is at least 4
        
if (APlayerData[playerid][PlayerLevel] >= 0)
        {
            if (
sscanf(params"i"Skin)) SendClientMessage(playerid0xFF0000AA"Digite: \"/setskin <skin-id (0-299)>\"");
            else
            {
                
// Check if the player entered a valid skin-id
                
if ((Skin >= 0) && (Skin <= 299))
                {
                    
// Set the skin for the player
                    
SetPlayerSkin(playeridSkin);
                    
// Let the other player know the reason too
                    
format(Msg128"{808080}Voce Mudou a Sua Skin pela Skin: {FFFFFF}%i"Skin);
                    
SendClientMessage(playerid0xFFFFFFFFMsg);
                }
                else
                    
SendClientMessage(playerid0xFFFFFFFF"{808080}Skin Invalida. Digite uma Skin de 0 a 299");
            }
        }
        else
            return 
0;
    }
    else
        return 
0;
    
// Let the server know that this was a valid command
    
return 1;