CMD:shakehand help. -
When a player do /shakehand [id] [style] and the player who requested is accepting, the animation only applies on me in my screen, but on their screen they're doing the animations while im not. its like not synced. How can i make both of them applies the animations? Here's the codes.
Код:
foreach(Player, i) {
if(GetPVarInt(i, "shrequest") == playerid) {
new
Float: ppFloats[3];
GetPlayerPos(i, ppFloats[0], ppFloats[1], ppFloats[2]);
if(!IsPlayerInRangeOfPoint(playerid, 5, ppFloats[0], ppFloats[1], ppFloats[2])) {
Count++;
SendClientMessageEx(playerid, COLOR_WHITE, "You're too far away. You can't accept the handshake right now.");
}
else {
switch(GetPVarInt(i, "shstyle")) {
case 1:
{
Count++;
PlayerFacePlayer( playerid, i );
ApplyAnimation( playerid, "GANGS", "hndshkaa", 4.0, 1, 1, 1, 0, 1000 );
ApplyAnimation( i, "GANGS", "hndshkaa", 4.0, 1, 1, 1, 0, 1000 );
SetPVarInt(i, "shrequest", INVALID_PLAYER_ID);
format(string, sizeof(string), "* %s has shook hands with %s.", GetPlayerNameEx(i), GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
DeletePVar(i, "shstyle");
}
case 2:
{
Count++;
PlayerFacePlayer( playerid, i );
ApplyAnimation( playerid, "GANGS", "hndshkba", 4.0, 1, 1, 1, 0, 1000 );
ApplyAnimation( i, "GANGS", "hndshkba", 4.0, 1, 1, 1, 0, 1000 );
SetPVarInt(i, "shrequest", INVALID_PLAYER_ID);
format(string, sizeof(string), "* %s has shook hands with %s.", GetPlayerNameEx(i), GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
DeletePVar(i, "shstyle");
}
case 3:
{
Count++;
PlayerFacePlayer( playerid, i );
ApplyAnimation( playerid, "GANGS", "hndshkca", 4.0, 1, 1, 1, 0, 1000 );
ApplyAnimation( i, "GANGS", "hndshkca", 4.0, 1, 1, 1, 0, 1000 );
SetPVarInt(i, "shrequest", INVALID_PLAYER_ID);
format(string, sizeof(string), "* %s has shook hands with %s.", GetPlayerNameEx(i), GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
DeletePVar(i, "shstyle");
}
case 4:
{
Count++;
PlayerFacePlayer( playerid, i );
ApplyAnimation( playerid, "GANGS", "hndshkcb", 4.0, 1, 1, 1, 0, 1000 );
ApplyAnimation( i, "GANGS", "hndshkca", 4.0, 1, 1, 1, 0, 1000 );
SetPVarInt(i, "shrequest", INVALID_PLAYER_ID);
format(string, sizeof(string), "* %s has shook hands with %s.", GetPlayerNameEx(i), GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
DeletePVar(i, "shstyle");
}
case 5:
{
Count++;
PlayerFacePlayer( playerid, i );
ApplyAnimation( playerid, "GANGS", "hndshkda", 4.0, 1, 1, 1, 0, 1000 );
ApplyAnimation( i, "GANGS", "hndshkca", 4.0, 1, 1, 1, 0, 1000 );
SetPVarInt(i, "shrequest", INVALID_PLAYER_ID);
format(string, sizeof(string), "* %s has shook hands with %s.", GetPlayerNameEx(i), GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
DeletePVar(i, "shstyle");
}
case 6:
{
Count++;
PlayerFacePlayer( playerid, i );
ApplyAnimation( playerid, "GANGS","hndshkfa_swt", 4.0, 1, 1, 1, 0, 2600 );
ApplyAnimation( i, "GANGS","hndshkfa_swt", 4.0, 1, 1, 1, 0, 2600 );
SetPVarInt(i, "shrequest", INVALID_PLAYER_ID);
format(string, sizeof(string), "* %s has shook hands with %s.", GetPlayerNameEx(i), GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
DeletePVar(i, "shstyle");
}
case 7:
{
Count++;
PlayerFacePlayer( playerid, i );
ApplyAnimation( playerid, "GANGS", "prtial_hndshk_01", 4.0, 1, 1, 1, 0, 1250 );
ApplyAnimation( i, "GANGS", "prtial_hndshk_01", 4.0, 1, 1, 1, 0, 1250 );
SetPVarInt(i, "shrequest", INVALID_PLAYER_ID);
format(string, sizeof(string), "* %s has shook hands with %s.", GetPlayerNameEx(i), GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
DeletePVar(i, "shstyle");
}
case 8:
{
Count++;
PlayerFacePlayer( playerid, i );
ApplyAnimation( playerid, "GANGS", "prtial_hndshk_biz_01", 3.7, 1, 1, 1, 0, 2200 );
ApplyAnimation( i, "GANGS", "prtial_hndshk_biz_01", 3.5, 1, 1, 1, 0, 2200 );
SetPVarInt(i, "shrequest", INVALID_PLAYER_ID);
format(string, sizeof(string), "* %s has shook hands with %s.", GetPlayerNameEx(i), GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
DeletePVar(i, "shstyle");
}
}
}
}
}
if(Count == 0) return SendClientMessageEx(playerid, COLOR_WHITE, "You don't have any pending handshake requests.");
return 1;
}
Re: CMD:shakehand help. -
at the end of ApplyAnimation, afther that time 1000, try adding afther that 2, that is parameter for forcesync
Re: CMD:shakehand help. -
Re: CMD:shakehand help. -
you now see a difference? its last parameter added of function ApplyAnimation
Re: CMD:shakehand help. -
This problem is most of the time caused because you didn't preload the animlibs, either apply the animations twice or preload the animlibs you wanna use
Re: CMD:shakehand help. -
Re: CMD:shakehand help. -
Re: CMD:shakehand help. -