Author Topic: I need some scripting help (Camera Shaking)!  (Read 1898 times)

Hello, i'm done trying to get someone to "spoon feed" me knowledge, and i've scripted something. The only problem is it doesn't seem to work, and i cant find the problem. Heres the script;

Code: [Select]
//Made By Zaw

function servercmdStun(%client, %user)
{
if(%client.isSuperAdmin == false)
{
return;
}
if(%user !$= "")
{
%target = findClientByName(%user).player;
%targetC = findClientByName(%user);
%target.shakeCamera();
messageClient(%client, '', '\c6You have stunned %1', %targetC.name);
}
}
Edit: Now I just need to know how to get the shakeCamera(); part to work

« Last Edit: February 12, 2009, 12:00:56 AM by Snip3r »

Well I'm gonna tell you, I know what the problem is. I forgot to tell you that that part of the script I sent you doesn't work! XD Kinda my fault I guess.

Well I'm gonna tell you, I know what the problem is. I forgot to tell you that that part of the script I sent you doesn't work! XD Kinda my fault I guess.
No, i made a new script and ran into a problem

Oh well then the problem probably has to do with that serverCmd or something, I really shouldn't try to help I know probably as much as you do at this point.

That whole script is complete bullstuff.

That whole script is complete bullstuff.
I started to actually understanding scripting within the hour, shut up and get out of my thread.

Burger if you're not going to help, don't post.

Burger if you're not going to help, don't post.
GameFandan, i realized your on a Mac. If you want to script better, please use Unitron

Download: http://www.mediafire.com/download.php?nwnd35yrzoy

._. You mean that some people don't actually hand-type their scripts? >.<

AND HOW DID YOU KNOW I'M ON A MAC?!?!? O.o

._. You mean that some people don't actually hand-type their scripts? >.<

AND HOW DID YOU KNOW I'M ON A MAC?!?!? O.o
No, people hand write there scripts, Unitron just lets you open unlimited amount of scripts in one window with a side tab, numbers your lines, and it also colors comments green, functions red, etc.

And i know your on a mac because you posted a screen shot showing you were on a mac in your sceptor help topic.

Now will someone just help me with my problem?

well look at a weapon script and find the part with the camera shake stuff and work with that ._.

well look at a weapon script and find the part with the camera shake stuff and work with that ._.
I did, it didn't help

Seriously, gamefandan, you're very new to scripting, and are in no way fit to help others.

I commented in a few areas, and used proper formatting.  There are a few ways you could cut down on the size of the code, but people need to take first learning coding logic one step at a time.
Code: [Select]
function servercmdStun(%client, %user)
{
if(%client.isSuperAdmin == false  || %user !$= "") //"=" is used for setting variables, such as "%variable= 5", you need to use "==", because that is used for comparing two variables.
{
return;
}
if(%user !$= "")
{
%target = findClientByName(%user).player;
%targetC = findClientByName(%user);
%target.shakeCamera(); //I don't know if this is a real function, and I can't get on to test if it is.  You may also not have everything you need to make it work.
messageClient(%client, '', '\c6You've Stunned %1', %targetC.name);
}
}

Though your better then someone who gets on the irc, asks how to use functions, then after asking what they do know several times they end up telling you they know nothing at all about coding.

Seriously, gamefandan, you're very new to scripting, and are in no way fit to help others.

I commented in a few areas, and used proper formatting.  There are a few ways you could cut down on the size of the code, but people need to take first learning coding logic one step at a time.
Code: [Select]
function servercmdStun(%client, %user)
{
if(%client.isSuperAdmin == false  || %user !$= "") //"=" is used for setting variables, such as "%variable= 5", you need to use "==", because that is used for comparing two variables.
{
return;
}
if(%user !$= "")
{
%target = findClientByName(%user).player;
%targetC = findClientByName(%user);
%target.shakeCamera(); //I don't know if this is a real function, and I can't get on to test if it is.  You may also not have everything you need to make it work.
messageClient(%client, '', '\c6You've Stunned %1', %targetC.name);
}
}

Though your better then someone who gets on the irc, asks how to use functions, then after asking what they do know several times they end up telling you they know nothing at all about coding.
I saw something similar in Weapon_IceBlast, which gave me the idea for the script, so i dont know exactly if its a real function