13.07.2015, 19:05
please i need a jail Position
+ interior id
+ interior id
CMD:jail(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new iTargetID, szReason[64]; if(sscanf(params, "us[64]", iTargetID, szReason)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /jail [playerid/partofname] [reason]"); } else if(IsPlayerConnected(iTargetID)) { if(AdminDuty[iTargetID] == 1) { return SendClientMessage(playerid, COLOR_WHITE, "You can't perform this action on on-duty admins."); } if(PlayerInfo[iTargetID][pAdmin] >= PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_WHITE, "You can't perform this action on equal or higher admins."); } //if(GetPVarInt(iTargetID, "PBM") > 0) LeavePaintballArena(iTargetID, GetPVarInt(iTargetID, "IsInArena")); new szMessage[128]; ResetPlayerWeaponsEx(iTargetID); if(PlayerDraggedBy[iTargetID] != INVALID_PLAYER_ID) { IsCopDragging[PlayerDraggedBy[iTargetID]] = INVALID_PLAYER_ID; PlayerDragged[iTargetID] = 0; PlayerDraggedBy[iTargetID] = INVALID_PLAYER_ID; } if(IsPlayerAttachedObjectSlotUsed(iTargetID, 0)) RemovePlayerAttachedObject(iTargetID, 0); PlayerInfo[iTargetID][pJailed] = 3; PhoneOnline[iTargetID] = 1; PlayerInfo[iTargetID][pJailTime] = 10*60; TogglePlayerControllable(iTargetID, 0); for(new o = 0; o < 6; o++) { TextDrawShowForPlayer(iTargetID, ObjectsLoadingTD[o]); } SetPVarInt(iTargetID, "LoadingObjects", 1); SetTimerEx("SafeLoadObjects", 3000, 0, "d", iTargetID); SetPlayerInterior(iTargetID, 69); PlayerInfo[iTargetID][pVW] = 696969; PlayerInfo[iTargetID][pInt] = 69; SetPlayerVirtualWorld(iTargetID, 696969); new rand = random(sizeof(AdminPrisonFloat)); SetPlayerPos(iTargetID, AdminPrisonFloat[rand][0], AdminPrisonFloat[rand][1], AdminPrisonFloat[rand][2]); format(szMessage, sizeof(szMessage), "AdmCmd: %s has been jailed by %s, reason: %s", GetPlayerNameEx(iTargetID), GetPlayerNameEx(playerid), szReason); SendClientMessageToAllEx(COLOR_LIGHTRED, szMessage); format(szMessage, sizeof(szMessage), "AdmCmd: %s has been jailed by %s, reason: %s", GetPlayerNameEx(iTargetID), GetPlayerNameEx(playerid), szReason); Log("logs/admin.log", szMessage); format(szMessage, sizeof(szMessage), "You have been jailed by Admin %s for 20 minutes, reason: %s.", GetPlayerNameEx(playerid), szReason); SendClientMessage(iTargetID, COLOR_LIGHTBLUE, szMessage); format(szMessage, sizeof(szMessage), "%s", szReason); SendClientMessage(iTargetID, COLOR_LIGHTBLUE, szMessage); strcpy(PlayerInfo[iTargetID][pPrisonedBy], GetPlayerNameEx(playerid), MAX_PLAYER_NAME); strcpy(PlayerInfo[iTargetID][pPrisonReason], szReason, 128); } else { SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!"); } } return 1; }
new Float:JailCoord[][] =
{
{198.310134, 161.985412, 1003.029968, 177.840881},
{197.993942, 175.298568, 1003.023437, 1.020530},
{193.767562, 175.545104, 1003.023437, 357.556182}
};
//for setting position
new rand = random(sizeof(JailCoord));
SetPlayerPosEx(playerid,JailCoord[rand][0], JailCoord[rand][1], JailCoord[rand][2]);
SetPlayerFacingAngle(playerid,JailCoord[rand][3]);
SetPlayerInterior(playerid,3);
SetPlayerVirtualWorld(playerid,0);
may it can help you
Код:
CMD:jail(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1) { new iTargetID, szReason[64]; if(sscanf(params, "us[64]", iTargetID, szReason)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /jail [playerid/partofname] [reason]"); } else if(IsPlayerConnected(iTargetID)) { if(AdminDuty[iTargetID] == 1) { return SendClientMessage(playerid, COLOR_WHITE, "You can't perform this action on on-duty admins."); } if(PlayerInfo[iTargetID][pAdmin] >= PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_WHITE, "You can't perform this action on equal or higher admins."); } //if(GetPVarInt(iTargetID, "PBM") > 0) LeavePaintballArena(iTargetID, GetPVarInt(iTargetID, "IsInArena")); new szMessage[128]; ResetPlayerWeaponsEx(iTargetID); if(PlayerDraggedBy[iTargetID] != INVALID_PLAYER_ID) { IsCopDragging[PlayerDraggedBy[iTargetID]] = INVALID_PLAYER_ID; PlayerDragged[iTargetID] = 0; PlayerDraggedBy[iTargetID] = INVALID_PLAYER_ID; } if(IsPlayerAttachedObjectSlotUsed(iTargetID, 0)) RemovePlayerAttachedObject(iTargetID, 0); PlayerInfo[iTargetID][pJailed] = 3; PhoneOnline[iTargetID] = 1; PlayerInfo[iTargetID][pJailTime] = 10*60; TogglePlayerControllable(iTargetID, 0); for(new o = 0; o < 6; o++) { TextDrawShowForPlayer(iTargetID, ObjectsLoadingTD[o]); } SetPVarInt(iTargetID, "LoadingObjects", 1); SetTimerEx("SafeLoadObjects", 3000, 0, "d", iTargetID); SetPlayerInterior(iTargetID, 69); PlayerInfo[iTargetID][pVW] = 696969; PlayerInfo[iTargetID][pInt] = 69; SetPlayerVirtualWorld(iTargetID, 696969); new rand = random(sizeof(AdminPrisonFloat)); SetPlayerPos(iTargetID, AdminPrisonFloat[rand][0], AdminPrisonFloat[rand][1], AdminPrisonFloat[rand][2]); format(szMessage, sizeof(szMessage), "AdmCmd: %s has been jailed by %s, reason: %s", GetPlayerNameEx(iTargetID), GetPlayerNameEx(playerid), szReason); SendClientMessageToAllEx(COLOR_LIGHTRED, szMessage); format(szMessage, sizeof(szMessage), "AdmCmd: %s has been jailed by %s, reason: %s", GetPlayerNameEx(iTargetID), GetPlayerNameEx(playerid), szReason); Log("logs/admin.log", szMessage); format(szMessage, sizeof(szMessage), "You have been jailed by Admin %s for 20 minutes, reason: %s.", GetPlayerNameEx(playerid), szReason); SendClientMessage(iTargetID, COLOR_LIGHTBLUE, szMessage); format(szMessage, sizeof(szMessage), "%s", szReason); SendClientMessage(iTargetID, COLOR_LIGHTBLUE, szMessage); strcpy(PlayerInfo[iTargetID][pPrisonedBy], GetPlayerNameEx(playerid), MAX_PLAYER_NAME); strcpy(PlayerInfo[iTargetID][pPrisonReason], szReason, 128); } else { SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!"); } } return 1; } |