Latest topics
» [Accepted] Unban Appealby VK.Angel.OfDeath Sun Mar 31, 2024 8:29 am
» [Solved] Password Reset
by VK.Angel.OfDeath Sat Mar 23, 2024 9:32 pm
» Ramadan Mubarak in Advance
by Shafin Sat Mar 23, 2024 1:52 pm
» Fatal Force - F2
by [F2]M60^ Sat Feb 24, 2024 4:07 pm
» Illegal Immigration | Old Memories | 2017
by BlackOps_Killer Fri Feb 09, 2024 5:25 pm
» VKs and VCMP Previews
by SJHere Sat Jan 20, 2024 1:51 pm
» The Resurgence 4th Year of Anniversary!
by Ninja Tue Jan 16, 2024 10:30 am
» [Solved]Stats Transfer application - Shado[W]^
by SJHere Mon Nov 27, 2023 5:06 pm
» Hi to all my good friends
by VK.Angel.OfDeath Sat Nov 18, 2023 9:04 am
» [Closed] Admin Application - F2.Ninja
by VK.Angel.OfDeath Sat Nov 18, 2023 8:49 am
» [Closed] Suggestion - We can change weather in props
by VK.Angel.OfDeath Sat Nov 18, 2023 8:45 am
» [Denied] Suggestion - Garbageman Job
by VK.Angel.OfDeath Sat Nov 04, 2023 8:27 pm
» Server Files (24/10/2023)
by VK.Angel.OfDeath Sun Oct 29, 2023 1:22 pm
» [Accepted] playaaa, ULK.Hulk. [M4]Halilibow - speed hacking in parkours
by VK.Angel.OfDeath Sun Oct 29, 2023 1:15 pm
» [Solved] Password Reset- TrapHole
by VK.Angel.OfDeath Sun Oct 29, 2023 1:13 pm
» [Solved] Request for Password Reset (2)
by VK.Angel.OfDeath Sat Oct 21, 2023 1:14 pm
» [Solved] Password Rest
by [RPG]G_man Thu Oct 05, 2023 9:07 pm
» [Noted] FPV Suggestion
by SJHere Sat Sep 02, 2023 8:31 pm
» [Solved] Pass Reset Application Foster^
by VK.Angel.OfDeath Fri Jul 28, 2023 12:00 pm
» Wanna start over again?
by palestrino Wed Jul 26, 2023 2:06 am
» hey guys <3
by D@Ch0uChI. Thu Jul 13, 2023 1:51 am
» [Solved] Stats Transfer
by SJHere Sat Jun 17, 2023 6:03 pm
» [Solved] Password Reset
by D4rKR420R Wed May 24, 2023 1:36 am
» Let's all gather after May in VKs
by Mike Sat May 20, 2023 4:55 pm
» [Denied] Player report - [ON]HunTinG
by D4rKR420R Tue May 02, 2023 5:25 am
» Hi halo here
by Alone Sun Apr 30, 2023 11:28 am
» An old Player Of Vks
by Alone Sat Apr 22, 2023 12:01 am
» [Bug Report] Bug in /domination - invisible bridge
by VK.Angel.OfDeath Wed Apr 19, 2023 3:38 pm
» [Noted] Bug Report - Zone
by LOGiC ™ Wed Mar 08, 2023 4:52 pm
» [Noted] Just Suggestion
by LOGiC ™ Wed Mar 08, 2023 4:11 pm
Top posters
ЧК. (8555) | ||||
VK.Angel.OfDeath (6454) | ||||
=SdS=KrlozZ... (6433) | ||||
D4rKR420R (5469) | ||||
=KF=Thunder^ (5405) | ||||
Pavonis (5197) | ||||
SJHere (4421) | ||||
Emma (4261) | ||||
Vipe[R] (3756) | ||||
47. (3704) |
Statistics
We have 1948 registered usersThe newest registered user is احمد
Our users have posted a total of 217818 messages in 16809 subjects
Most Viewed Topics
Top posting users this month
No user |
Top posting users this week
No user |
[Solved] scripting help
5 posters
Page 1 of 1
[Solved] scripting help
bassicly a topic that will help me with scripting anyone else trying to learn can post 2
function onPlayerCommand( player, command, arguments )
{
local cmd, text;
cmd = command;
text = arguments;
if(cmd == "heal")
{
local hp = player.Health;
if(hp == 100) Message("[#FF3636]Error - [#8181FF]Use this command when you have less than 100% hp !");
else {
player.Health = 100.0;
Message("[#FFFF81]---> You have been healed !");
}
}
else if(cmd == "exec")
{
if( !text ) MessagePlayer( "Error - Syntax: /exec <Squirrel code>", player);
else
{
try
{
local script = compilestring( text );
script();
}
catch(e) MessagePlayer( "Error: " + e, player);
}
}
else if (cmd == "yell'")
{
MessagePlayer( "this is test", player) // VK.Andriusas91
if(player == 1) MessagePlayer ("Sucsess");
else {
message("hello !")
}
}
return 1;
}
function onPlayerCommand( player, command, arguments )
{
local cmd, text;
cmd = command;
text = arguments;
if(cmd == "heal")
{
local hp = player.Health;
if(hp == 100) Message("[#FF3636]Error - [#8181FF]Use this command when you have less than 100% hp !");
else {
player.Health = 100.0;
Message("[#FFFF81]---> You have been healed !");
}
}
else if(cmd == "exec")
{
if( !text ) MessagePlayer( "Error - Syntax: /exec <Squirrel code>", player);
else
{
try
{
local script = compilestring( text );
script();
}
catch(e) MessagePlayer( "Error: " + e, player);
}
}
else if (cmd == "yell'")
{
MessagePlayer( "this is test", player) // VK.Andriusas91
if(player == 1) MessagePlayer ("Sucsess");
else {
message("hello !")
}
}
return 1;
}
Last edited by VK.Andriusas91 on Sun Jun 21, 2015 4:31 pm; edited 2 times in total
Re: [Solved] scripting help
Add the thing I marked with a red color.
VK.Angel.OfDeath- Server Owner & Forum Admin
- Posts : 6454
Points : 9307
Reputation : 127
Join date : 2012-10-28
Age : 29
Location : Sweden
BlackOps_Killer- Legendary Member
- Gender :
Posts : 1855
Points : 2409
Reputation : 206
Join date : 2015-02-15
Age : 21
Location : Kosovo, Europe
Re: [Solved] scripting help
Too many bugs here... forgot many semicolons, player is never zero because its an instance (it might be null) but it cant be here because a player called this callback, message doesnt exist its MessageAll etc.
EK.CrystalBlue- Deputy Chief of the Community
-
Posts : 3621
Points : 4218
Reputation : 28
Join date : 2012-10-31
Age : 31
Location : I am CRYSTAL u never found me!!!!!
Re: [Solved] scripting help
NE.CrystalBlue wrote:Too many bugs here... forgot many semicolons, player is never zero because its an instance (it might be null) but it cant be here because a player called this callback, message doesnt exist its MessageAll etc.
BlackOps_Killer- Legendary Member
- Gender :
Posts : 1855
Points : 2409
Reputation : 206
Join date : 2015-02-15
Age : 21
Location : Kosovo, Europe
Re: [Solved] scripting help
VK.Angel.OfDeath wrote:Add the thing I marked with a red color.
Solved.
=SdS=KrlozZ...- Ultra Legendary
- Gender :
Posts : 6433
Points : 7855
Reputation : 103
Join date : 2016-02-13
Age : 26
Location : Here >:)
Similar topics
» Help In scripting
» News about scripting.
» [Scripting] Please vote for what you want.
» Scripting Ideas - What do you guys think.
» Scripting update on what you guys said.
» News about scripting.
» [Scripting] Please vote for what you want.
» Scripting Ideas - What do you guys think.
» Scripting update on what you guys said.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum