31.05.2017, 14:36
/greet works fine, it sends the message but /acceptgreet doesn't work for some reason and doesn't apply any animation at all.
PHP код:
CMD:greet(playerid, params[])
{
new id, number, string[128], Float:X, Float:Y, Float:Z;
GetPlayerPos(id, X, Y, Z);
if(sscanf(params,"u", id, number)) return SCM(playerid, COLOR_GREY,"[Usage]: /greet [playerid/partofname] [greet (0-6)].");
if(playerid == id) return SCM(playerid, COLOR_LIGHTRED,"[Error]: You can't greet yourself.");
if(IsPlayerInRangeOfPoint(playerid, 7.0, X, Y, Z))
{
format(string, sizeof(string), "%s would like to greet you. Type /acceptgreet if you further wish.", GetName(playerid));
SendClientMessage(id, COLOR_YELLOW, string);
greetInvited[id] = true;
greetNumber = number;
Player_Greet[id] = playerid;
}
else return SCM(playerid, COLOR_LIGHTRED, "[Error]: You're not close enough.");
return 1;
}
CMD:acceptgreet(playerid, params[])
{
if(greetInvited[playerid] == false) return SCM(playerid, COLOR_LIGHTRED,"[Error]: You're not invited to greet anyone");
if(greetNumber == 1)
{
ApplyAnimation(playerid, "GANGS", "hndshkfa", 4.1, 0, 1, 1, 1, 1, 1);
ApplyAnimation(Player_Greet[playerid], "GANGS", "hndshkfa", 4.1, 0, 1, 1, 1, 1, 1);
}
else if(greetNumber == 2)
{
ApplyAnimation(playerid, "GANGS", "hndshkaa", 4.1, 0, 1, 1, 1, 1, 1);
ApplyAnimation(Player_Greet[playerid], "GANGS", "hndshkaa", 4.1, 0, 1, 1, 1, 1, 1);
}
else if(greetNumber == 3)
{
ApplyAnimation(playerid, "GANGS", "hndshkba", 4.1, 0, 1, 1, 1, 1, 1);
ApplyAnimation(Player_Greet[playerid], "GANGS", "hndshkba", 4.1, 0, 1, 1, 1, 1, 1);
}
else if(greetNumber == 4)
{
ApplyAnimation(playerid, "GANGS", "hndshkca", 4.1, 0, 1, 1, 1, 1, 1);
ApplyAnimation(Player_Greet[playerid], "GANGS", "hndshkca", 4.1, 0, 1, 1, 1, 1, 1);
}
else if(greetNumber == 5)
{
ApplyAnimation(playerid, "GANGS", "hndshkda", 4.1, 0, 1, 1, 1, 1, 1);
ApplyAnimation(Player_Greet[playerid], "GANGS", "hndshkda", 4.1, 0, 1, 1, 1, 1, 1);
}
else if(greetNumber == 6)
{
ApplyAnimation(playerid, "GANGS", "hndshkea", 4.1, 0, 1, 1, 1, 1, 1);
ApplyAnimation(Player_Greet[playerid], "GANGS", "hndshkea", 4.1, 0, 1, 1, 1, 1, 1);
}
return 1;
}