Help about skins - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help about skins (
/showthread.php?tid=149594)
Help about skins -
ViruZZzZ_ChiLLL - 22.05.2010
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?
Re: Help about skins -
Blt950 - 22.05.2010
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
Re: Help about skins -
NewTorran - 22.05.2010
pawn Код:
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(GetPlayerSkin(i) == 0) // CJ
{
GameTextForPlayer(i, "The CJ Skin is Taken", 2500, 4);
}
}
Re: Help about skins -
Blt950 - 22.05.2010
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
Re: Help about skins -
Antonio [G-RP] - 22.05.2010
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
Re: Help about skins -
ViruZZzZ_ChiLLL - 22.05.2010
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?
Re: Help about skins -
Antonio [G-RP] - 22.05.2010
Blah
Re: Help about skins -
Blt950 - 22.05.2010
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.
Re: Help about skins -
Killa_ - 22.05.2010
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.
Re: Help about skins -
Antonio [G-RP] - 22.05.2010
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;
}