22.05.2012, 21:45
Queria saber como colocar pra verificar se o player esta em /handsup. pq queria implantar pra o comando /algemar se o player esta de handsup. Vlw
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_HANDSUP)
{ ........................................ } eu ja tinha colocado isso no comando , mais eu pensei em q te tipo ele estaria verificando se o cop nao estaria de hands . ai eu apaguei e to procurando um jeito correto de fazer |
if (strcmp(cmd, "/handsup", true) == 0)
{
EmAnim[playerid] = true;
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);
return true;
}
if(strcmp(cmd, "/algemar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й um policial!");
return true;
}
if(OnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo Bateu o cartгo!");
return true;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Use: /algemar [id]");
return true;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo pode algemar COPs !");
return true;
}
if(PlayerCuffed[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador jб esta algemado !");
return true;
}
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_HANDSUP)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador nгo estб em /handsup !");
return true;
}
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
new car = GetPlayerVehicleID(playerid);
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Vocк nao pode se algemar!"); return true; }
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2 && IsPlayerInVehicle(giveplayerid, car))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Vocк foi algemado pelo: %s.", PlayerName(playerid));
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Vocк algemou %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s Algemou %s, para nao fugir.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Algemado", 2500, 3);
Controle(giveplayerid, 0);
PlayerCuffed[giveplayerid] = 2;
PlayerInfo[giveplayerid][pMuted] = 1;
SetPlayerAttachedObject(giveplayerid, 4, 19418, 6, -0.031999, 0.024000, -0.024000, -7.900000, -32.000011, -72.299987, 1.115998, 1.322000, 1.406000);
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador nгo estб no carro ou vocк nгo й o motorista !");
return true;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador estб longe de Vocк !");
return true;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador Estб Offline !");
return true;
}
}
return true;
}
if(GetPlayerSpecialAction(giveplayerid) != SPECIAL_ACTION_HANDSUP)
if(strcmp(cmd, "/algemar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(!IsACop(playerid))
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo й um policial!");
return true;
}
if(OnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo Bateu o cartгo!");
return true;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Use: /algemar [id]");
return true;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
{
SendClientMessage(playerid, COLOR_GREY, " Vocк nгo pode algemar COPs !");
return true;
}
if(PlayerCuffed[giveplayerid] > 0)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador jб esta algemado !");
return true;
}
if(GetPlayerSpecialAction(giveplayerid) == SPECIAL_ACTION_HANDSUP)
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador nгo estб em /handsup !");
return true;
}
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
new car = GetPlayerVehicleID(playerid);
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Vocк nao pode se algemar!"); return true; }
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2 && IsPlayerInVehicle(giveplayerid, car))
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Vocк foi algemado pelo: %s.", PlayerName(playerid));
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Vocк algemou %s.", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s Algemou %s, para nao fugir.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Algemado", 2500, 3);
Controle(giveplayerid, 0);
PlayerCuffed[giveplayerid] = 2;
PlayerInfo[giveplayerid][pMuted] = 1;
SetPlayerAttachedObject(giveplayerid, 4, 19418, 6, -0.031999, 0.024000, -0.024000, -7.900000, -32.000011, -72.299987, 1.115998, 1.322000, 1.406000);
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador nгo estб no carro ou vocк nгo й o motorista !");
return true;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador estб longe de Vocк !");
return true;
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " O Jogador Estб Offline !");
return true;
}
}
return true;
}