Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 08-14-2012, 11:51 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 clarke119 View Post
This is the involved parts - not the full script. This is the last attempt I made at trying to do this..

PHP Code:
function onActionServerside(){
 if(
params[0] == "rankchanger"){
    
temp.pl findplayerbycommunityname(params[1]);
    if (
pl != NULL){
        
rank pl.clientr.gangrank;
        
rights pl.clientr.gangrights;
 }
}
      else{
      
player.chat "Player not found.";
 }

Just realized that part. You mixed this
PHP Code:
rank pl.clientr.gangrank;
rights pl.clientr.gangrights
it should be

PHP Code:
pl.clientr.gangrank params[2];
pl.clientr.gangrights params[3]; 
Also you should find the player with findPlayer(acc); rather than using findPlayerByCommunityname(acc); since not everyone got a communityname. In the end it should look like:
PHP Code:
function onActionServerside(){
  if(
params[0] == "rankchanger"){
    
temp.pl findPlayer(params[1]);
    if (
temp.pl != NULL){
      
pl.clientr.gangrank params[2];
      
pl.clientr.gangrights params[3];
    }
    else {
      
player.chat "Player not found.";
    }
  }

__________________
MEEP!
Reply With Quote
  #17  
Old 08-15-2012, 12:44 AM
clarke119 clarke119 is offline
Registered User
Join Date: May 2010
Posts: 23
clarke119 is on a distinguished road
Quote:
Originally Posted by callimuc View Post
Just realized that part. You mixed this
PHP Code:
rank pl.clientr.gangrank;
rights pl.clientr.gangrights
it should be

PHP Code:
pl.clientr.gangrank params[2];
pl.clientr.gangrights params[3]; 
Also you should find the player with findPlayer(acc); rather than using findPlayerByCommunityname(acc); since not everyone got a communityname. In the end it should look like:
PHP Code:
function onActionServerside(){
  if(
params[0] == "rankchanger"){
    
temp.pl findPlayer(params[1]);
    if (
temp.pl != NULL){
      
pl.clientr.gangrank params[2];
      
pl.clientr.gangrights params[3];
    }
    else {
      
player.chat "Player not found.";
    }
  }

Excellent. Thank you very much for your help!
__________________
Reply With Quote
  #18  
Old 08-15-2012, 12:46 AM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
Oh good you were able to fix it, the other part I was gonna add to it was to check rights to see if you can even hire to begin with.

Side note, findplayerbycommunityname(acc) will change to findplayer(acc) by default if null.
__________________
Reply With Quote
  #19  
Old 08-15-2012, 12:55 AM
clarke119 clarke119 is offline
Registered User
Join Date: May 2010
Posts: 23
clarke119 is on a distinguished road
Quote:
Originally Posted by Tim_Rocks View Post
Oh good you were able to fix it, the other part I was gonna add to it was to check rights to see if you can even hire to begin with.

Side note, findplayerbycommunityname(acc) will change to findplayer(acc) by default if null.
Yeah, I already have the checks in place, but removed to avoid confusion and make it as easy as possible for people to understand. Since I quit, I sometimes have these moments were I make mistakes and forget simple thing!

Also, yeah thats what I thought:O.

Anyway thanks a lot for your help guys, an asset to the forums!
__________________
Reply With Quote
  #20  
Old 08-15-2012, 01:38 AM
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 Tim_Rocks View Post
Side note, findplayerbycommunityname(acc) will change to findplayer(acc) by default if null.
Oh didn't know that. Cool
__________________
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 08:06 PM.


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