Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-22-2012, 11:18 PM
Fysez Fysez is offline
Banned
Join Date: Apr 2012
Posts: 89
Fysez has a little shameless behaviour in the past
Question Zoom Script?

I made a zoom script, And i know i'm not the only one who has.
But I did this, and it doesn't show up to others as enlarged?
I've tried different ways but the clientside makes it nearly impossible for me to work with.
PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
if (
player.chat.starts("/zoom ")) {
player.zoom player.chat.substring(7).trim();
setzoomeffect this.zoom;
}

Reply With Quote
  #2  
Old 05-22-2012, 11:54 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Well first you must know why it doesn't work. Players send certain variables to the server, and thus that data is then shared with other visible players. These variables include important data like player.x, player.y, player.attr[0-30], looks and so on and so forth. This data is needed for you to keep an accurate account of other players(knowing where they are, what they look like and so on). However besides those important variables, many are not sent. This includes things like player.zoom, client.vars, and such.

In order to share that data, you're going to have to force it to other players using one of the variables that ARE shared, and you will accomplish this using player.attr's.

PHP Code:
function onPlayerChats() {
  if (
player.chat.starts("/zoom ")) {
    
temp.newzoom player.chat.substring(7).trim();
    
// Be careful not to overwrite attr's already being used by other scripts
    
player.attr[5] = newzoom;
  }

Now what you'll also need to designate a special gani as an attr as well. This gani will contain SCRIPT portion that sets the player's zoom to attr[5]. Since the gani is also an attr, other players will load the script from the gani, which will load your attr[5], thus setting your zoom appropriately when they see you.

PHP Code:
function onPlayerChats() {
  if (
player.chat.starts("/zoom ")) {
    
temp.newzoom player.chat.substring(7).trim();
    
// Be careful not to overwrite attr's already being used by other scripts
    
player.attr[5] = newzoom;
    
player.attr[6] = "Fysez_playerzoom.gani";
  }

I have no gani to share though for this, so you'll have to do the research yourself. Eventually you can write up a small parsing script that lets you compress all of this data into one attr, to save data. You can also pass other things like player.alpha, player.stretch and so on.
Reply With Quote
  #3  
Old 06-07-2012, 09:29 PM
Fysez Fysez is offline
Banned
Join Date: Apr 2012
Posts: 89
Fysez has a little shameless behaviour in the past
I don't know how to 'Script' Gani's. However,
I don't know why i didn't think of it, But I ended up working with triggers
to make the zoom work.
So here it is for anyone who wants to use it=P
PHP Code:
findplayer("Graal781471").addweapon(this.name);
function 
onActionServerSide() {
if (
params[0] == "zoom") {
setzoomeffect this.zoom;
} else if (
params[0] == "overzoom") {
player.chat "Zoom effect is too big! Big zoom = HUGE lag!";
}
}
//#CLIENTSIDE
function onPlayerChats() {
if (
player.chat.starts("/zoom ")) {
if (
player.chat.substring(6)=<9) {
player.zoom player.chat.substring(7).trim();
triggerserver("gui",this.name,"zoom",0,player.account,0.5);
} else if (
player.chat.substring(6)=>9) {
triggerserver("gui",this.name,"overzoom",0,player.account,0.5);
}
}

Reply With Quote
  #4  
Old 06-07-2012, 09:38 PM
Hezzy002 Hezzy002 is offline
Registered User
Join Date: Jul 2011
Posts: 247
Hezzy002 is a jewel in the roughHezzy002 is a jewel in the rough
There's no way that script works at all, mate. There's a lot of issues with it and Dusty explained how to do it with one of the most reasonable techniques.
Reply With Quote
  #5  
Old 06-07-2012, 10:28 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by Fysez View Post
I don't know how to 'Script' Gani's. However,
I don't know why i didn't think of it, But I ended up working with triggers
to make the zoom work.
So here it is for anyone who wants to use it=P
PHP Code:
findplayer("Graal781471").addweapon(this.name);
function 
onActionServerSide() {
if (
params[0] == "zoom") {
setzoomeffect this.zoom;
} else if (
params[0] == "overzoom") {
player.chat "Zoom effect is too big! Big zoom = HUGE lag!";
}
}
//#CLIENTSIDE
function onPlayerChats() {
if (
player.chat.starts("/zoom ")) {
if (
player.chat.substring(6)=<9) {
player.zoom player.chat.substring(7).trim();
triggerserver("gui",this.name,"zoom",0,player.account,0.5);
} else if (
player.chat.substring(6)=>9) {
triggerserver("gui",this.name,"overzoom",0,player.account,0.5);
}
}

Did you even check your RC after saying "/zoom #"?

Also I'd call it an 'overcomplicated clientside stealth script'
__________________
MEEP!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:46 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.