View Single Post
  #78  
Old 05-01-2009, 02:43 AM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
Use:

PHP Code:
clientr.weapon_img "weaponname.png"
for strings


onKeyPressed is called on default. Basically all of the event if's were converted to "function onEvent", such as "onPlayerTouchsMe", "onCreated", and "onPlayerEnters". There's no need for the if (keypressed) statement.



hideimg might be actually destroying the image (actually, I'm pretty sure it does). Just hide it with findImg().visible. And, I don't think showimg has that many paramaters.

Plus.... you're combining GS1 and GS2 in a horrible way


Something like this I guess...

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.wep_type.sword "sword.png";
}
function 
displayImage() {
  
showimg(200getImageForType(clientr.weaponType), 00);
}
function 
getImageForType(wep) {
  return 
this.wep_type.(@ wep);

and just set clientr.weaponType or another variable when you change the player's weapon. Also, there's really no reason to use clientr. for a weapon image.

And, I'm pretty sure you're adding an extra parameter to showimg almost everywhere. Press F2 and click on "Scripts", it may be giving an error.
Ahh thanks. And yea, I am not adding an extra parameter in the actual scripts, just mashing the comma here to represent that parameters DO follow.

Quote:
Originally Posted by cbk1994 View Post
Use:

PHP Code:
clientr.weapon_img "weaponname.png"
for strings
I did this:

PHP Code:
clientr.weapon_img "raelyn_sword.png";

if (
trigger){
  
showimg index,clientr.weapon_img,x,y;

Still not producing an image.

Edit: Bah, I got it to work with #s.

*slap forehead*
__________________
*Don't let the door hit you on the way out.*

Last edited by Raelyn; 05-01-2009 at 02:49 AM.. Reason: Doh!
Reply With Quote