Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:tie(playerid, params[])
- {
- if(PlayerInfo[playerid][pRope] > 0)
- {
- new string[128], giveplayerid;
- if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /tie [playerid]");
- if(IsPlayerConnected(giveplayerid))
- {
- if(PlayerTied[giveplayerid] > 0)
- {
- SendClientMessageEx(playerid, COLOR_GREY, " Player already Tied!");
- return 1;
- }
- if(PlayerCuffed[giveplayerid] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't tie a cuffed/tazed player.");
- if(PlayerInfo[giveplayerid][pJailed] >= 1)
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You can't tie a prisoned player.");
- return 1;
- }
- if(PlayerInfo[playerid][pRope] == 0)
- {
- SendClientMessageEx(playerid, COLOR_WHITE, "You don't have any rope left.");
- }
- else
- {
- if (ProxDetectorS(8.0, playerid, giveplayerid))
- {
- new car = GetPlayerVehicleID(playerid);
- if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot tie up yourself!"); return 1; }
- if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == 2 && IsPlayerInVehicle(giveplayerid, car))
- {
- if(PlayerCuffed[giveplayerid] == 1 || PlayerCuffed[giveplayerid] == 2) {
- SendClientMessageEx(playerid, COLOR_GRAD2, "You can't do this right now.");
- return 1;
- }
- format(string, sizeof(string), "* You were tied up by %s, till untie.", GetPlayerNameEx(playerid));
- SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* You tied %s up, till untie.", GetPlayerNameEx(giveplayerid));
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* %s ties %s up, so he wont go anywhere.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- GameTextForPlayer(giveplayerid, "~r~Tied", 2500, 3);
- SetPVarInt(giveplayerid, "IsFrozen", 1);
- TogglePlayerControllable(giveplayerid, 0);
- PlayerTied[giveplayerid] = 1;
- PlayerInfo[playerid][pRope]--;
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, " Player not in your Car, or you are not the Driver!");
- return 1;
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
- return 1;
- }
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
- return 1;
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, " You don't have a Rope!");
- }
- return 1;
- }
- CMD:untie(playerid, params[])
- {
- new string[128], giveplayerid;
- if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /untie [playerid]");
- if(IsPlayerConnected(giveplayerid))
- {
- if (ProxDetectorS(8.0, playerid, giveplayerid))
- {
- if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot Untie yourself!"); return 1; }
- if(PlayerCuffed[giveplayerid] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "You can't untie a cuffed/tazed player.");
- if(PlayerTied[giveplayerid])
- {
- DeletePVar(giveplayerid, "IsFrozen");
- format(string, sizeof(string), "* You were untied by %s.", GetPlayerNameEx(playerid));
- SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* You untied %s.", GetPlayerNameEx(giveplayerid));
- SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
- GameTextForPlayer(giveplayerid, "~g~Untied", 2500, 3);
- TogglePlayerControllable(giveplayerid, 1);
- PlayerTied[giveplayerid] = 0;
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, " That player isn't Tied up!");
- return 1;
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "That player isn't near you.");
- return 1;
- }
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement