Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:risti(playerid,params[])
- {
- if (!playerDB[playerid][virve])
- return SendClientMessage(playerid, RED, "Jūs neturite virvės.");
- new id;
- if (sscanf(params, "u", id))
- return SendClientMessage(playerid, BLUE, "Surišti/atrišti žaidėją: /risti [vardo_dalis]");
- if (id == playerid || id == INVALID_PLAYER_ID)
- return SendClientMessage(playerid, RED, "Tokio žaidėjo nėra!");
- if ((IsPlayerInAnyVehicle(playerid) && GetPlayerState(id) == PLAYER_STATE_ONFOOT)
- || (IsPlayerInAnyVehicle(id) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT))
- return SendClientMessage(playerid, RED, "Tiek jūs, tiek žaidėjas turi būti ant kojų/mašinoje");
- new Float: risPos[3];
- GetPlayerPos(id, risPos[0], risPos[1], risPos[2]);
- if (!IsPlayerInRangeOfPoint(playerid, 5, risPos[0], risPos[1], risPos[2]))
- return SendClientMessage(playerid, RED, "Jūs esate per toli.");
- new cuffPlayer[71];
- if (IsPlayerInAnyVehicle(playerid) && IsPlayerInVehicle(id, GetPlayerVehicleID(playerid)))
- {
- new Seat[2];
- Seat[0] = GetPlayerVehicleSeat(playerid);
- Seat[1] = GetPlayerVehicleSeat(id);
- if ((Seat[0] == 2 || Seat[1] == 3) && (Seat[1] == 2 || Seat[1] == 3))
- {
- format(cuffPlayer, 70, "%s {FFFFFF}jus bando {FF0000}%s.", PlayerName(playerid), (playerDB[id][gcuffed]) ? ("bando atrišti") : ("bando surišti"));
- SendClientMessage(id, 0xFF0000FF, cuffPlayer);
- format(cuffPlayer, 70, "Jūs bandote {FF0000}%s {FFFFFF}%s", PlayerName(id), (!playerDB[id][gcuffed]) ? ("surišti") : ("atrišti"));
- SendClientMessage(playerid, 0xFFFFFFFF, cuffPlayer);
- SetTimerEx("CuffPlayer", 5000, false, "dddfff", playerid, id, (playerDB[id][gcuffed]) ? (true) : (false), 0.0, 0.0, 0.0);
- }
- else
- SendClientMessage(playerid, COLOR_RED, "Jus arba žaidėjas kurį norite surakinti nesėdi tr. priemonės gale.");
- }
- else if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && GetPlayerState(id) == PLAYER_STATE_ONFOOT)
- {
- format(cuffPlayer, 70, "%s {FFFFFF}jus bando {FF0000}%s.", PlayerName(playerid), (playerDB[id][gcuffed]) ? ("bando atrišti") : ("bando surišti"));
- SendClientMessage(id, 0xFF0000FF, cuffPlayer);
- format(cuffPlayer, 70, "Bandote {FF0000}%s {FFFFFF}%s", PlayerName(id), (!playerDB[id][gcuffed]) ? ("surišti") : ("atrišti"));
- SendClientMessage(playerid, 0xFFFFFFFF, cuffPlayer);
- SetTimerEx("CuffPlayer", 5000, false, "dddfff", playerid, id, (playerDB[id][gcuffed]) ? (true) : (false), Pos[0], Pos[1], Pos[2]);
- }
- return true;
- }
- forward CuffPlayer(playerid, id, bool: ristate, Float: risX, Float: risY, Float: risZ);
- public CuffPlayer(playerid, id, bool: ristate, Float: risX , Float: risY, Float: risZ)
- {
- new cuffPlayer[39];
- if (ristate)
- {
- playerDB[playerid][virve] = true;
- playerDB[id][gcuffed] = false;
- if (GetPlayerSpecialAction(id) == SPECIAL_ACTION_CUFFED)
- {
- SetPlayerSpecialAction(id, SPECIAL_ACTION_NONE);
- }
- TogglePlayerControllable(id, true);
- format(cuffPlayer, 36, "Atrišote %s.", PlayerName(id));
- SendClientMessage(playerid, GREEN, cuffPlayer);
- format(cuffPlayer, 38, "Jus atrišo %s.", PlayerName(playerid));
- SendClientMessage(id, RED, cuffPlayer);
- }
- else
- {
- new Float: risPos[3];
- GetPlayerPos(id, risPos[0], risPos[1], risPos[2]);
- if ((risPos[0] != risX || risPos[1] != risY || risPos[2] != risZ) || !IsPlayerInRangeOfPoint(playerid, 5, risPos[0], risPos[1], risPos[2]))
- return SendClientMessage(playerid, RED, "ˇaidejo suriti nepavyko, riant tiek jus tiek riamas ˛aidejas turi nejudeti.");
- playerDB[playerid][virve] = false;
- playerDB[id][gcuffed] = true;
- if (GetPlayerState(id) == PLAYER_STATE_ONFOOT)
- {
- SetPlayerSpecialAction(id, SPECIAL_ACTION_CUFFED);
- }
- TogglePlayerControllable(id, false);
- format(cuffPlayer, 36, "Surišote %s.", PlayerName(id));
- SendClientMessage(playerid, GREEN, cuffPlayer);
- format(cuffPlayer, 38, "Jus surišo %s.", PlayerName(playerid));
- SendClientMessage(id, RED, cuffPlayer);
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement