Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Kewun on May 28, 2016, 09:41 AM

Title: vote kick from dany [ bug ]
Post by: Kewun on May 28, 2016, 09:41 AM
there is a bug, i didnt want to bump his topic of script
so, i can votekick a player, but i can vote him milion times using /vote command, and he will get kicked
players can abuse the /vote command, please fix it!
Title: Re: vote kick from dany [ bug ]
Post by: Cool on May 28, 2016, 09:47 AM
check if player is already voted message him you already voted
for example if ( pstats[player.ID].Noob ) MessagePlayer("you are a noob.",player);
are u sure you are using this http://forum.vc-mp.org/?topic=345.0
Title: Re: vote kick from dany [ bug ]
Post by: Kewun on May 28, 2016, 09:57 AM
   else if( cmd == "vote" )
{
if( !text ) MessagePlayer("[#FF0000][Syntax]:[#ADFF2F] /vote <Nick/ID>.", player );
else
{
local plr = GetPlayer( text );
if( !plr ) MessagePlayer("[#FF0000][Error]:[#F5F5F5]Invalid Player.", player );
else if(( plr ) && ( !stats[ plr.ID ].VKick )) MessagePlayer("[#F5F5F5][Info]:[#ADFF2F]there is no vote kick on that player..", player );
else if(( plr ) && ( stats[ player.ID ].Voted == plr.Name )) MessagePlayer("[#F5F5F5][Info]:[#ADFF2F]you already voted!", player );
else
{
Message("[#ADFF2F][VoteKick]:[#FFFF00]" + player.Name + " has voted agaisnt " + plr.Name + "." );
Message("[#ADFF2F][votekick]:[#F5F5F5]vote count on " + plr.Name + " - [ " + stats[ plr.ID ].Count + "/3]." );
stats[ plr.ID ].Count++;
}
}
}
}
Title: Re: vote kick from dany [ bug ]
Post by: Kewun on May 28, 2016, 09:58 AM
i think the error is

   else if(( plr ) && ( stats[ player.ID ].Voted == plr.Name )) MessagePlayer("[#F5F5F5][Info]:[#ADFF2F]you already voted!", player );

and yeah im using http://forum.vc-mp.org/?topic=345.0
Title: Re: vote kick from dany [ bug ]
Post by: Anik on May 28, 2016, 10:11 AM
Wrong Board
Title: Re: vote kick from dany [ bug ]
Post by: Coolkid on May 28, 2016, 03:06 PM
add this on top in class PlayerStats
Voted = false
and here your command
else if( cmd == "vote" )
 {
  if( !text ) MessagePlayer("[#FF0000][Syntax]:[#ADFF2F] /vote <Nick/ID>.", player );
  else
  {
   local plr = GetPlayer( text );
   if( !plr ) MessagePlayer("[#FF0000][Error]:[#F5F5F5]Invalid Player.", player );
   else if(( plr ) && ( !stats[ plr.ID ].VKick )) MessagePlayer("[#F5F5F5][Info]:[#ADFF2F]there is no vote kick on that player..", player );
   else if(( plr ) && ( stats[ player.ID ].Voted == true )) MessagePlayer("[#F5F5F5][Info]:[#ADFF2F]you already voted!", player );
   else
   {
    Message("[#ADFF2F][VoteKick]:[#FFFF00]" + player.Name + " has voted agaisnt " + plr.Name + "." );
    Message("[#ADFF2F][votekick]:[#F5F5F5]vote count on " + plr.Name + " - [ " + stats[ plr.ID ].Count + "/3]." );
    stats[ plr.ID ].Count++;
stats[ player.ID ].Voted = true;
   }
  }
 }
}
Title: Re: vote kick from dany [ bug ]
Post by: Kewun on May 28, 2016, 04:20 PM
OMG THX MAN FINALLY! <3 u
(k no homo) ::)
anyway, thanks!!!