Thank you both of you, and thank's Omar, for clarifying that.
This does not seem to work, for a apperant reason . . . .
I also noticed reborn mentioned a way but I'm not to sure on how to do the "transtion" . If I use the change_character function then set_model it won't set the model to the desired model I want it'll only change the character.
.h code
class MyTimerScript : public ScriptImpClass
{
void Created(GameObject *obj);
Commands->Start_Timer(obj, this, 1.0f, 1);
void Timer_Expired(GameObject *obj, int number);
{
if(number == 1) //if timer with number (ID) 1 ended (the 10 second timer)
{
Commands->Set_Model(obj, "clown");
}
};
gmmain.cpp chat hook code
class testChatCommand : public ChatCommandClass {
void Triggered(int ID,const TokenClass &Text,int ChatType) {
GameObject *obj = Get_GameObj(ID);
float Credits = Commands->Get_Money(obj);
int Team = Get_Object_Type(obj);
Vector3 position;
position = Commands->Get_Position(obj);
{
if(Credits >= 10 && (Team == 0) ){
Commands->Give_Money(obj,-10,false);
char message[256];
sprintf(message,"msg %s has bought a test character.", Get_Player_Name_By_ID(ID));
Console_Input(message);
Commands->Attach_Script(obj, "MyTimerScript" , "");
Commands->Set_Position(obj,position);
}
else{
Console_Input(StrFormat("ppage %d You need 10 credits for this selection!.",Get_Player_ID(obj)).c_str());
}
}
}
};
ChatCommandRegistrant<testChatCommand> testChatCommandReg("!test",CHATTYPE_ALL,0,GAMEMODE_AOW);
I really don't know what's wronge maybe I'm not attaching it correctly :L
[Updated on: Wed, 11 August 2010 12:51]
Report message to a moderator