Vice City: Multiplayer

Server Development => Scripting and Server Management => Snippet Showroom => Topic started by: Alecu Madalin on Oct 09, 2019, 05:32 PM

Title: Super triple mega simple random skin changer
Post by: Alecu Madalin on Oct 09, 2019, 05:32 PM
you got the idea i don't need to exmplain
cmd = cmd.tolower()
if (cmd == "skin") {
    player.Skin =  rand() % 300
    MessagePlayer( "[#FFFFFF]You're now a " + GetSkinName( player.Skin ), player );
    //MessagePlayer("You're a lizard harry XDD", player)
}
Title: Re: Super triple mega simple random skin changer
Post by: NicusorN5 on Oct 10, 2019, 03:40 PM
If rand() % 300 equals a value like 199 you should know that the player skin will remain the default.
Title: Re: Super triple mega simple random skin changer
Post by: Alecu Madalin on Oct 10, 2019, 07:40 PM
Quote from: Athanatos on Oct 10, 2019, 03:40 PMIf rand() % 300 equals a value like 199 you should know that the player skin will remain the default.

yes i know that
maybe i will update
but nah it doesnt worth nothing
Title: Re: Super triple mega simple random skin changer
Post by: MatheuS on Oct 10, 2019, 10:43 PM
Quote from: Alecu Madalin on Oct 10, 2019, 07:40 PM
Quote from: Athanatos on Oct 10, 2019, 03:40 PMIf rand() % 300 equals a value like 199 you should know that the player skin will remain the default.

yes i know that
maybe i will update
but nah it doesnt worth nothing

cmd = cmd.tolower()
if (cmd == "skin") {
    local random = rand() % 300;
    if( random > 199 ) player.Skin = 0;
    else player.Skin = random;
    MessagePlayer( "[#FFFFFF]You're now a " + GetSkinName( player.Skin ), player );
    //MessagePlayer("You're a lizard harry XDD", player)
}