SA-MP Forums Archive
Skin HElp - 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: Skin HElp (/showthread.php?tid=614104)



Skin HElp - b0b - 04.08.2016

PHP код:
COMMAND:mskin(playerid, params[])
{
    new 
playerb, string[128], skinid;
    if(
Logged[playerid] == true)
    {
        if(
PlayerInfo[playerid][pAdmin] >= 2)
        {
            if(!
sscanf(params, "ds", playerb, skinid))
            {
                if(
IsPlayerConnected(playerb))
                {
                    if(
skinid <= 299 && skinid >= 1)
                    {
                        
format(string, sizeof(string), "ADMIN: %s seadistas %s skinni[Skin: %d]", RPName(playerid), RPName(playerb), skinid);
                        
SendAdminMessage(COLOR_YELLOW, string);
                        
format(string, sizeof(string), "Administraator %s seadistas su skinni, Skin: %d", RPName(playerid), skinid);
                        
SendClientMessage(playerb, COLOR_WHITE, string);
                        
SetPlayerSkin(playerb, skinid);
                    }
                    else 
SendClientMessage(playerid, COLOR_RED, "Skin ei saa olla alla 1 voi suurem kui 299");
                }
                else 
SendClientMessage(playerid, V_SININE, "Sellist mangijat ei leitud");
            }
            else 
SendClientMessage(playerid, V_SININE, "{3BB9FF}KASUTA: {FFFFFF}/teeskin [id] [Skinid]");
        }
        else 
SendClientMessage(playerid, COLOR_GRAD1, "Sul pole хigusi, et seda commandi kasutada.");
    }
    else 
SendClientMessage(playerid, V_SININE, "Sa ei ole veel sisse loginud");
    return 
1;
} 
This ise the code.
And Pic


Like if i but 299 it set random skin why?


Re: Skin HElp - oMa37 - 04.08.2016

PHP код:
if(!sscanf(params, "ds", playerb, skinid)) 
to

PHP код:
if(sscanf(params, "ui", playerb, skinid)) 



Re: Skin HElp - b0b - 04.08.2016

Quote:
Originally Posted by oMa37
Посмотреть сообщение
PHP код:
if(!sscanf(params, "ds", playerb, skinid)) 
to

PHP код:
if(sscanf(params, "ui", playerb, skinid)) 
Yep. but now its say "player not foud" Why?


Re: Skin HElp - Logic_ - 04.08.2016

If you are using 0.3.7, then there are skins from 0 to 311.


Re: Skin HElp - b0b - 04.08.2016

Quote:
Originally Posted by TopShooter
Посмотреть сообщение
Use this -,-

PHP код:
if(sscanf(params, "id", playerb, skinid)) 

Ty its work :3


Re: Skin HElp - oMa37 - 04.08.2016

Quote:
Originally Posted by TopShooter
Посмотреть сообщение
It's not going to work ._. he has to put id, not ui neither ds.

This one below should work
PHP код:
if(sscanf(params, "id", playerb, skinid)) 
The way I shared works fine for me by the way.


Re: Skin HElp - Vince - 04.08.2016

If "u" does not work correctly then sscanf isn't installed correctly. Also "d" and "i" are interchangeable.


Re: Skin HElp - Deadpoop - 04.08.2016

Quote:
Originally Posted by TopShooter
Посмотреть сообщение
It's not going to work ._. he has to put id, not ui neither ds.

This one below should work
PHP код:
if(sscanf(params, "id", playerb, skinid)) 
Actually ui should work!

u- username/id
i-integer

so I don't see any good reason why it wouldn't work