Thread: how to make...
View Single Post
  #4  
Old 08-02-2001, 03:11 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by konidias
I think he means without having to write out every single color... you use string parsing.. its pretty easy:

NPC Code:

// NPC made by Konidias
if (playerchats && !strequals(#c,)){
tokenize #c;
setstring this.temp1,#t(0);
setstring this.temp2,#t(1);
if (strequals(#s(this.temp1),belt)){
setplayerprop #C4,#s(this.temp2);
}}



Make an npc and put that in it, and then run the level and say "belt red" or any other color in place of red

The npc check to see if the player chats, and then it tokenizes the words the player says, it sets two temporary strings
temp 1 is "belt" and temp 2 is the color

Then it checks if temp 1 = belt, if it does, then set the players belt to temp 2 (color)

There you go.. if you wanted to add different parts do something like this

NPC Code:

if (strequals(#s(this.temp1),coat)){
setplayerprop #C1,#s(this.temp2);
}



Place that before the last } and that will add changing the players coat color as well
u can just do
NPC Code:

if (playerchats&&startswith(belt ,#c)) {
tokenize #c;
setbeltcolor #s(#t(1));
}



not sure if #s() is needed tho.
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote