09.05.2012, 18:19
Hello all, so I searched on some older topics when the "BETA" of 0.3e was released. I found this code, and translated it to english, and corrected to if(IsPlayerAdmin(playerid)) instead of gTeam and Cop etc.
ServerFFS is CRAP and haven't released the 0.3e yet, so I was just wondering if this code will work? If not, please correct :
ServerFFS is CRAP and haven't released the 0.3e yet, so I was just wondering if this code will work? If not, please correct :
pawn Код:
if(strcmp(cmd, "/cuff", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerAdmin(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_RED, ".:: Correction: /cuff [id/name] ::.");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(IsPlayerAdmin(playerid))
{
SendClientMessage(playerid, COLOR_CRVENA, ".:: You cant cuff an Officer! ::.");
return 1;
}
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_CRVENA, ".:: You cant Cuff youself! ::."); return 1; }
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), ".:: ( %s ) has Cuffed ( %s ) and he cant move! ::.", sendername ,giveplayer);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(giveplayerid, "~r~Cuffed!", 2500, 3);
SendClientMessage(giveplayerid, COLOR_PLAVA, ".:: Lawyer: Anything you say can and will be used against you ::.");
SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);
SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
TogglePlayerControllable(giveplayerid, 0);
PlayerCuffed[giveplayerid] = 2;
PlayerCuffedTime[giveplayerid] = 9999;
}
else
{
SendClientMessage(playerid, COLOR_CRVENA, ".:: This player is too far away from your Area ::.");
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_CRVENA, ".:: Unavailable ID! No one has that ID ::.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, ".:: You're Not a Cop, and therefor cant Cuff ::.");
}
}
return 1;
}