Please Help! /sleep command
#1

I try to make a /sleep command, but when I try it, it works only in first 4 or 5 house. Please help! Here is the code :

if(strcmp(cmd, "/sleep", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(PlayerToPoint(400, playerid, HouseInfo[h][hExitx], HouseInfo[h][hExity], HouseInfo[h][hExitz]))
{
if(PlayerInfo[playerid][pSleep] == 0)
{
SetPlayerColor(playerid,0x737373FF);
TogglePlayerControllable(playerid,0);
ApplyAnimation(playerid, "CRACK", "Lay_Bac_Loop", 4.0,0,1,1,1,0);
SendClientMessage(playerid, COLOR_GREEN, "blablabla");
PlayerInfo[playerid][pSleep] = 1;
return 1;
}
else if(PlayerInfo[playerid][pSleep] == 1)
{
SetPlayerToTeamColor(playerid);
ClearAnimations(playerid);
TogglePlayerControllable(playerid,1);
SendClientMessage(playerid, COLOR_GREEN, "blablabla);
PlayerInfo[playerid][pSleep] = 0;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "blablabla");
return 1;
}
}
return 1;
}
}

And one more thing: if you know a good anim for sleep tell me!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)