Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Kewun on Aug 07, 2016, 07:38 AM

Title: on Check point Entered
Post by: Kewun on Aug 07, 2016, 07:38 AM
function onCheckpointEntered(player,sphere)
{
if (sphere.ID==0)
{
if (player.WantedLevel > 0)
{
MessagePlayer("[#ffffff]You are wanted!!!",player)
return false;
}
if(player.Skin != 1)
{
player.Skin = 1;
MessagePlayer("[#ffffff]You started police mission!",player)
}
if (player.Skin == 1)
{
player.Skin = 7;
MessagePlayer("[#ffffff]You quited police mission!",player)
}
}
}
when i walk in the checkpoint, it floods the messages, how to fix this ? :(


screenshot: http://imgur.com/a/mUI1Y
Title: Re: on Check point Entered
Post by: Xmair on Aug 07, 2016, 09:22 AM
Use else if.
Title: Re: on Check point Entered
Post by: Kewun on Aug 07, 2016, 09:49 AM
same thing happens, but less flashes

Title: Re: on Check point Entered
Post by: jayant on Aug 07, 2016, 06:07 PM
Try this -
//upper codes
//if player is wanted,return false,check other things
if(player.Skin != 1)
 {
 player.Skin = 1;
 MessagePlayer("[#ffffff]You started police mission!",player)
 }
else if (player.Skin == 1)
 {
 player.Skin = 7;
 MessagePlayer("[#ffffff]You quited police mission!",player)
 }
Title: Re: on Check point Entered
Post by: Kewun on Aug 10, 2016, 04:48 PM
worked, thx