Author Topic: Help with my script  (Read 4058 times)

Code:
//command
function severCmd????(%client){
 %client.player.????();
}

Could someone help me with this? where the ?'s are i want to add velstioy could someone help

Raggle to the fraggle
« Last Edit: May 09, 2009, 09:01:34 AM by AGlass0fMilk »

Ok ty this is my VERY first addon if you can can you give me some packageing tips plz

You first put that code above in Notepad (if your on a PC, if you aren't, don't ask me) and then save it as server.cs. Right click that file and click send to compressed (zipped) file, then make a description.txt save that and put it in the zip file with the server.cs and then cut that zip file into your add ons folder.

so this is called Script_scriptnamehere right?

%target needs to be findclientbyname(%client).player; and you should probably make it admin only otherwise people will be chucking each other all over the bedroom..
EDIT: And why in hell do people use findclientbyname even though they have the client?
« Last Edit: May 08, 2009, 10:25:50 PM by Destiny/Zack0Wack0 »

i need some help i cant fuiger out how to get it onto my blockland and i got 3 mins left on here

They use findclientbyname so they can type in the clients name into the server command.

They use findclientbyname so they can type in the clients name into the server command.
Your script won't even return a valid client...

This:
Code: [Select]
//command
function servercmdaddvelocity(%client, %vel)
{
%target = findclientbyname(%client);
%target.addvelocity(%vel);
}
I'm pretty sure that should work, you would type: /addvelocity name number
I agree, but it should be
function clcmdaddvelocity(%client, %vel)
{
yadayadayada...

I agree, but it should be
function clcmdaddvelocity(%client, %vel)
{
yadayadayada...
...


Code: [Select]
//command
function servercmdaddvelocity(%client, %vel)
{
%target = findclientbyname(%client);
%target.addvelocity(%vel);
}
This code absolutely will not work.

If it found a valid client whose name happened to contain the random sequence of numbers that your client ID is, then you would get a GameConnection::addVelocity "unknown command" error.

If you did make it apply to the client's player, then they would accelerate in the X direction only, which makes it useless.

This:
Code: [Select]
//command
function servercmdaddvelocity(%client, %vel)
{
%target = findclientbyname(%client);
%target.addvelocity(%vel);
}
I'm pretty sure that should work, you would type: /addvelocity name number

Stop trying to help people, all you do is totally confuse them and teach them stuff. Seriously.