27.05.2014, 15:02
Hello! i make for my server /usemask cmd, have problem: I created a mask with the mask is very CreateObject but not exactly worth, and generally does not move with the person need your help, I will be very grateful!
Sorry for my bad english.
PHP код:
if(strcmp(cmd, "/usemask", true) == 0)// маска
{
if(PlayerInfo[playerid][pMask] == 1)
{
if(PlayerInfo[playerid][pMaskOn] == 0)
{
PlayerInfo[playerid][pMaskOn] = 1;
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 0);
}
SendClientMessage(playerid,COLOR_YELLOW,"Вы одели маску");
PlayerInfo[playerid][pMaskSkill] -= 1;
maska = CreateObject(19038, 1,1,1,0,0,0);
AttachObjectToPlayer(maska, playerid, 0,0.1,0.67, 0, 0, 90 );
if(PlayerInfo[playerid][pMaskSkill] <= 0)
{
new ranran = random(100);
if(ranran < 2)
{
SendClientMessage(playerid,COLOR_LIGHTRED,"Вы порвали маску");
DestroyObject(maska);
PlayerInfo[playerid][pMaskSkill] = 0;
PlayerInfo[playerid][pMask] = 0;
PlayerInfo[playerid][pMaskOn] = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
ShowPlayerNameTagForPlayer(i, playerid, 1);
}
}
}
}
else if(PlayerInfo[playerid][pMaskOn] == 1)
{
PlayerInfo[playerid][pMaskOn] = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
}
ShowPlayerNameTagForPlayer(i, playerid, 1);
}
DestroyObject(maska);
SendClientMessage(playerid,COLOR_YELLOW,"Вы сняли маску");
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"У вас нет маски");
}
return 1;
}