Help about skins
#1

How can I make a skin lets say CJ, be taken already
if someone already is CJ, and if its taken, the new
comers will receive a GameTextForAll that CJ is already
taken?
Reply
#2

Hmm.. I think I know how to do it.

When somone tries to take it, you do a loop to check if anyone has that skin currently (https://sampwiki.blast.hk/wiki/GetPlayerSkin)
Then if you get a hit on the loop, you return the player to spawn with it, and prints the message
Reply
#3

pawn Код:
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(GetPlayerSkin(i) == 0) // CJ
{
GameTextForPlayer(i, "The CJ Skin is Taken", 2500, 4);
}
}
Reply
#4

Quote:
Originally Posted by Joe Torran C
pawn Код:
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(GetPlayerSkin(i) == 0) // CJ
{
GameTextForPlayer(i, "The CJ Skin is Taken", 2500, 4);
}
}
Yeah, that looks good. Thanks Joe, I were too lazy to script that self

I think your problem is solved Viruz
Reply
#5

Thats the basic script, but I think hes saying, once somebody has taken the skin, it is not able to be used. Therefore, the 0 // CJ skin, will have to be converted to a function (?) like a "Public" where once somebody takes the skin, it saves under it?

Or maybe in PlayerInfo, do a player mod/skin check, and if selectedskin = strval(tmp) == PlayerInfo[i][pModel(skin)] then you get the message
Reply
#6

Quote:
Originally Posted by Blt950
Quote:
Originally Posted by Joe Torran C
pawn Код:
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(GetPlayerSkin(i) == 0) // CJ
{
GameTextForPlayer(i, "The CJ Skin is Taken", 2500, 4);
}
}
Yeah, that looks good. Thanks Joe, I were too lazy to script that self

I think your problem is solved Viruz
Yeah, thanks Joe Torran C

I have another question though....

How can I make a car only enterable for a certain skin?
Reply
#7

Blah
Reply
#8

Quote:
Originally Posted by Antonio (eternalrp.webatu.com)
Thats the basic script, but I think hes saying, once somebody has taken the skin, it is not able to be used. Therefore, the 0 // CJ skin, will have to be converted to a function (?) like a "Public" where once somebody takes the skin, it saves under it?

Or maybe in PlayerInfo, do a player mod/skin check, and if selectedskin = strval(tmp) == PlayerInfo[i][pModel(skin)] then you get the message
I don't think that's needed. By that loop you know someone have that skin or not of ALL players on server.
So even that player disconnect, a new one would be able to use it.
I think it would work perfectly.
Reply
#9

Quote:
Originally Posted by Joe Torran C
pawn Код:
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(GetPlayerSkin(i) == 0) // CJ
{
GameTextForPlayer(i, "The CJ Skin is Taken", 2500, 4);
}
}
This code will not do what the topic creator asked for.
Reply
#10

Quote:
Originally Posted by ViruZZzZ_ChiLLL
Quote:
Originally Posted by Blt950
Quote:
Originally Posted by Joe Torran C
pawn Код:
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(GetPlayerSkin(i) == 0) // CJ
{
GameTextForPlayer(i, "The CJ Skin is Taken", 2500, 4);
}
}
Yeah, that looks good. Thanks Joe, I were too lazy to script that self

I think your problem is solved Viruz
Yeah, thanks Joe Torran C

I have another question though....

How can I make a car only enterable for a certain skin?
pawn Код:
forward IsACJCar[MAX_VEHICLES];
pawn Код:
public IsACJCar(carid)
{
new vmod = GetVehicleModel(carid);
if(vmod == 400)
{
return 1;
}
return 0;
}
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
newcar = GetPlayerVehicleID(playerid);
if(IsACJCar(newcar) && GetPlayerSkin != 0)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR, "This vehicle is for players with a CJ skin, only!");
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)