Password protected skin - HELP
#1

I want some skins to be locked so noone can spawn with it unless you have the password...
So i read this guide at wiki https://sampwiki.blast.hk/wiki/How_to_pa..._protect_skins

But i dont know where i should put the skind id's, i've read the guide carefully but i can't find where to add the ID, so please help me
Reply
#2

Does anyone know?
Reply
#3

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
    case 0: Locked[playerid] = 0; //this one DOESNT.
    case 1: Locked[playerid] = 0; //this one too
    case 2: Locked[playerid] = 1; //this is going to be locked, right?
    }
    return 1;
}
You will notice that each case is in numerical order, beginning from zero. Those numbers are actually skin ID's.
Reply
#4

So..if i want skin 265 locked how would it look like?

Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
    case 0: Locked[playerid] = 0; //this one DOESNT.
    case 1: Locked[playerid] = 0; //this one too
    case 265: Locked[playerid] = 1; //this is going to be locked, right?
    }
    return 1;
}
Like that?
Reply
#5

I would assume so.
Reply
#6

Quote:
Originally Posted by litesp
Посмотреть сообщение
So..if i want skin 265 locked how would it look like?

Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
    case 0: Locked[playerid] = 0; //this one DOESNT.
    case 1: Locked[playerid] = 0; //this one too
    case 265: Locked[playerid] = 1; //this is going to be locked, right?
    }
    return 1;
}
Like that?
no, classid and skinid are 2 different things. The skin id is the id of the model of a skin. The class id is the number that identifies a class.
Reply
#7

Quote:
Originally Posted by [GF]Sasino97
Посмотреть сообщение
no, classid and skinid are 2 different things. The skin id is the id of the model of a skin. The class id is the number that identifies a class.
Ah that's right. I was mistaken.
Reply
#8

So where do i put the Skin ID then?
Reply
#9

Bump.
Reply
#10

Like they said on the wiki
Код:
    AddPlayerClass(221, 0, 0, 0, 130, 24, 300, 0, 0, 0, 0); //Class 0
    AddPlayerClass(212, 0, 0, 0, 130, 24, 300, 0, 0, 0, 0); //Class 1
    AddPlayerClass(199, 0, 0, 0, 130, 24, 300, 0, 0, 0, 0); //Class 2
For example, you have those 3 skins already, and you wanna add a new playerclass with skin 1 (this will be passworded).

Код:
AddPlayerClass(221, 0, 0, 0, 130, 24, 300, 0, 0, 0, 0); //Class 0
AddPlayerClass(212, 0, 0, 0, 130, 24, 300, 0, 0, 0, 0); //Class 1
AddPlayerClass(199, 0, 0, 0, 130, 24, 300, 0, 0, 0, 0); //Class 2
AddPlayerClass(1, 0, 0, 0, 130, 24, 300, 0, 0, 0, 0); // Class3
Then your OnPlayerRequestClass should look like this

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0: Locked[playerid] = 0; // Class 0, skin 221
        case 1: Locked[playerid] = 0; // Class 1, skin 212
        case 2: Locked[playerid] = 0; // Class 2, skin 199
        case 3: Locked[playerid] = 1; // Class 3, skin 1 <-- this one is locked
    }
    return 1;
}
Hope this helps
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)