08.04.2013, 12:24
Hello I would like you to help me to create a command of greeting that puts the two players face each other and makes him shake hands or other animations of torque. example: /greets (id)
I've tried but I can not (the anim is wrong):
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new xid, idx;
new tmp[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/greets", true) == 0) {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid,0x00FF00FF, "USAGE: /greets [playerid]");
return 1;
}
xid = strval(tmp);
if(!IsPlayerConnected(xid)) {
SendClientMessage(playerid,0x00FF00FF, "greets: player don't exists.");
return 1;
}
new Float
, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerLookAt(xid, x, y);
GetPlayerPos(xid, x, y, z);
SetPlayerLookAt(playerid, x, y);
ApplyAnimation(playerid,"WUZI","Wuzi_Greet_Wuzi",4 .0,0,0,0,0,0);
ApplyAnimation(playerid,"WUZI","Wuzi_Greet_Wuzi",4 .0,0,0,0,0,0);
ApplyAnimation(xid,"WUZI","Wuzi_Greet_Wuzi",4.0,0, 0,0,0,0);
ApplyAnimation(xid,"WUZI","Wuzi_Greet_Wuzi",4.0,0, 0,0,0,0);
return 1;
}
return 1;
}
I've tried but I can not (the anim is wrong):
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256];
new xid, idx;
new tmp[256];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/greets", true) == 0) {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid,0x00FF00FF, "USAGE: /greets [playerid]");
return 1;
}
xid = strval(tmp);
if(!IsPlayerConnected(xid)) {
SendClientMessage(playerid,0x00FF00FF, "greets: player don't exists.");
return 1;
}
new Float
, Float:y, Float:z;GetPlayerPos(playerid, x, y, z);
SetPlayerLookAt(xid, x, y);
GetPlayerPos(xid, x, y, z);
SetPlayerLookAt(playerid, x, y);
ApplyAnimation(playerid,"WUZI","Wuzi_Greet_Wuzi",4 .0,0,0,0,0,0);
ApplyAnimation(playerid,"WUZI","Wuzi_Greet_Wuzi",4 .0,0,0,0,0,0);
ApplyAnimation(xid,"WUZI","Wuzi_Greet_Wuzi",4.0,0, 0,0,0,0);
ApplyAnimation(xid,"WUZI","Wuzi_Greet_Wuzi",4.0,0, 0,0,0,0);
return 1;
}
return 1;
}

