Vice City: Multiplayer

Server Development => Scripting and Server Management => Snippet Showroom => Topic started by: Zihad-VCMP on Oct 15, 2015, 05:22 AM

Title: My first snippet- Troll
Post by: Zihad-VCMP on Oct 15, 2015, 05:22 AM
Hi guys I am Zihad and I am not good in scripting. I could do things in pawn during 0.3z but after 0.4 only played but I always wanted to try out Squirrel even I found it very hard but for some reasons I am finding it more interesting ( xD ). So I can script a bit now. I wanted to share my first command. Its nothing though, but just sharing. Hoping to improve.


Paste these in your script in "  onPlayerCommand "

else if(cmd == "troll")
{
MessageAll("** " + player.Name + " is in trouble help him by typing /helphim");
}

else if(cmd == "helphim")
{
MessagePlayer("You got trolled xD", player);
player.Health = 0.0;
MessageAll("** " + player.Name + " has been trolled XD !");
MessageAll("** If you dont wanna be trolled then type /notroll")
}

else if(cmd == "notroll")
{
MessagePlayer("You got trolled xD ", player);
        player.Health = 0.0;
MessageAll("** " + player.Name + " has been trolled XD !");
MessageAll("** If you dont wanna be trolled then type /notroll")
}
Title: Re: My first snippet- Troll
Post by: EK.IceFlake on Oct 15, 2015, 05:27 AM
Error: The index EMessage does not exist.
Don't try to solve it I just figured it out by looking at EMessage as I'm not those usual FinchGuys :D
Btw what I mean is EMessage only exists in some scripts
You can replace it with Message (maybe MessageAll)
Title: Re: My first snippet- Troll
Post by: Zihad-VCMP on Oct 15, 2015, 05:32 AM
Thanks Crystal I will fix it ASAP :D
Title: Re: My first snippet- Troll
Post by: Xmair on Oct 15, 2015, 07:14 AM
Hehehe XD Nice one, Hope you get successful in future scripting.
Title: Re: My first snippet- Troll
Post by: KAKAN on Oct 15, 2015, 08:30 AM
Hehe! Nice trolling :P
Hope you get better soon.
Sometimes this cmds also make fun.
Title: Re: My first snippet- Troll
Post by: :P on Oct 15, 2015, 08:53 AM
Nice Work