PDA

View Full Version : problem with addguildmember..


Deas_Voice
11-13-2007, 09:29 PM
Hey, i want this to add to the guildguildname.txt,
so if i chat /AddGuild guildname accountname nickname it wound appear in the
guildguildname.txt
ex: /addguild LAT Deas_Voice Neo (then my account and nick appear in the guildLAT.txt as Deas_Voice:Neo)

//#SERVERSIDE
function onActionServerSide() {
if (params[0] == "AddGuild") {
with (findplayer(params[0])) {
addguildmember( @params[1],params[0],player.nick);
//addguildmember(str guildname, str accountname, str nickname);
}
}
}

//#CLIENTSIDE
function onPlayerChats(){
if (player.chat.starts ("/AddGuild ")) {
triggerserver("gui",this.name,"AddGuild",player.account,player.chat.substring(10));
}
}


get it?
and im also wondring whats the param for playernick so i used player.nick ;)
please help me:)

Inverness
11-13-2007, 10:52 PM
player.nick is the correct param, however, player.nick would also include the guild name at the end of the nickname.

Example:
player.guild: "Moon"
player.nick: "*Inverness (Moon)"

Deas_Voice
11-15-2007, 02:07 PM
player.nick is the correct param, however, player.nick would also include the guild name at the end of the nickname.

Example:
player.guild: "Moon"
player.nick: "*Inverness (Moon)"

x_x no i want (tryd) to make so u have to do the "setnick Neo (Moon)"
but insted of having to download the guildMoon.txt and add it, u can say "/addguild Moon Deas_Voice Neo" then it happear in the file by it self >_<
then u have to use "setnick" insted of a "/stafftag" thats controld by a player flag.

xAndrewx
11-15-2007, 04:16 PM
function onActionServerside(option) {
if (temp.option == "createGuild") {
temp.guildName = player.chat.substring(9).trim();
addGuildMember(temp.guildName, player.account, player.nick);

player.chat = "Created guild:" SPC temp.guildName @ "!";
player.guild = temp.guildName;
}
}
//#CLIENTSIDE
function onPlayerChats() {
if (player.chat.starts("/addGuild")) {
triggerserver("weapon", this.name, "createGuild");
}
}


You might want to actually check if the guild already exists ^^

Deas_Voice
11-15-2007, 04:58 PM
You might want to actually check if the guild already exists ^^
and if i want to add other peppol to the file by this command?
that was my idea from the start^^

xAndrewx
11-15-2007, 06:47 PM
function onActionServerside(option) {
if (temp.option == "addMember") {
temp.chat = player.chat.substring(4).trim().tokenize();
addGuildMember("Guild Name Here", temp.chat[0], temp.chat[1]);
}
}
//#CLIENTSIDE
function onPlayerChats() {
if (player.chat.starts("/add")) {
triggerserver("weapon", this.name, "addMember");
}
}

/add "account name" "nickname"
^- Need the commas

Knightmare1
11-16-2007, 03:13 AM
wow neo, youve gotten way better than when we worked on moon light, i cant wait to see how u improve on levels! :D

Deas_Voice
11-16-2007, 03:52 PM
wow neo, youve gotten way better than when we worked on moon light, i cant wait to see how u improve on levels! :D

thanks :) ,
have chris made a apartment system yet. x_x

and andrew thanks you too.

Knightmare1
11-16-2007, 11:48 PM
thanks :) ,
have chris made a apartment system yet. x_x

and andrew thanks you too.


i dont know about the system... hes working on cars i think